/- Copyright (c) 2026 Terence Tao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -/ import Mathlib.Algebra.Group.Pointwise.Set.Card import Mathlib.Algebra.Module.ZMod import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Defs import Mathlib.LinearAlgebra.Dimension.Finrank import Mathlib.LinearAlgebra.FreeModule.Finite.Basic /-! # Marton's conjecture (the polynomial Freiman–Ruzsa conjecture) This file states, in Mathlib-only terms, the headline theorems of three papers: * `[GGMT]` W. T. Gowers, Ben Green, Freddie Manners, Terence Tao, *On a conjecture of Marton*, arXiv:2311.05762. * `[GGMT2]` W. T. Gowers, Ben Green, Freddie Manners, Terence Tao, *Marton's conjecture in abelian groups with bounded torsion*, arXiv:2404.02244. * `[L]` Jyun-Jie Liao, *Improved exponent for Marton's conjecture in $\mathbf{F}_2^n$*, arXiv:2404.09639. Marton's conjecture, widely known as the polynomial Freiman–Ruzsa conjecture, asserts that a subset `A` of an abelian group with small doubling, `|A + A| ≀ K * |A|`, is efficiently covered by cosets of a subgroup no larger than `A`, with a number of cosets polynomial in `K`. The six statements below are: * `Marton.pfr_conjecture` β€” `[GGMT]`, Theorem 1.2: the conjecture in `𝔽₂ⁿ`, with `2 * K ^ 12` cosets. * `Marton.pfr_conjecture_nine` β€” `[L]`, main theorem: the same conclusion with `2 * K ^ 9` cosets. This strengthens `Marton.pfr_conjecture`, which is retained because it is the headline theorem of a different paper. * `Marton.torsion_pfr_conjecture` β€” `[GGMT2]`, Theorem 1.1: the conjecture in an arbitrary abelian group of torsion `m`, with `m * K ^ (256 * m ^ 3 + 1)` cosets. * `Marton.weak_pfr_int` β€” `[GGMT]`, Theorem 1.3: a set of small doubling in a finitely generated free `β„€`-module has a large subset of logarithmically small affine dimension. * `Marton.homomorphism_pfr` β€” `[GGMT]`, Corollary 1.4: a map whose additive defects take few values differs from a homomorphism by a map with small range. * `Marton.approx_hom_pfr` β€” `[GGMT]`, Corollary 1.5: a map that is additive on a positive proportion of pairs agrees with a homomorphism on a positive proportion of points. All statements are phrased with `Nat.card`, `Set` pointwise arithmetic, `AddSubgroup`, `vectorSpan` and `Module.finrank`, so that no definition of this project is needed in order to read them. Torsion hypotheses are stated as `βˆ€ x : G, m β€’ x = 0` rather than through a `Module (ZMod m) G` instance, so that the statements do not depend on which `ZMod`-algebra instance path is in scope. -/ open Pointwise namespace Marton /-- **Marton's conjecture in characteristic 2**, `[GGMT]`, Theorem 1.2. If `A` is a finite non-empty subset of an abelian group `G` of exponent `2` β€” that is, `2 β€’ x = 0` for every `x : G`, so that `G` is an `𝔽₂`-vector space β€” and `|A + A| ≀ K * |A|`, then `A` is covered by fewer than `2 * K ^ 12` cosets of a subgroup `H` of `G` with `|H| ≀ |A|`. The ambient group `G` is not required to be finite; the covering set `c` and the subgroup `H` produced are then finite. This statement is superseded by `Marton.pfr_conjecture_nine`, and is recorded separately because it is the headline theorem of `[GGMT]`. -/ theorem pfr_conjecture {G : Type*} [AddCommGroup G] (h2 : βˆ€ x : G, 2 β€’ x = 0) {A : Set G} (hA : A.Finite) (hAβ‚€ : A.Nonempty) {K : ℝ} (hAK : Nat.card (A + A) ≀ K * Nat.card A) : βˆƒ (H : AddSubgroup G) (c : Set G), c.Finite ∧ (H : Set G).Finite ∧ Nat.card c < 2 * K ^ 12 ∧ Nat.card H ≀ Nat.card A ∧ A βŠ† c + H := by sorry /-- **Marton's conjecture in characteristic 2 with exponent 9**, `[L]`, main theorem. If `A` is a finite non-empty subset of an abelian group `G` of exponent `2` β€” that is, `2 β€’ x = 0` for every `x : G`, so that `G` is an `𝔽₂`-vector space β€” and `|A + A| ≀ K * |A|`, then `A` is covered by fewer than `2 * K ^ 9` cosets of a subgroup `H` of `G` with `|H| ≀ |A|`. The ambient group `G` is not required to be finite; the covering set `c` and the subgroup `H` produced are then finite. -/ theorem pfr_conjecture_nine {G : Type*} [AddCommGroup G] (h2 : βˆ€ x : G, 2 β€’ x = 0) {A : Set G} (hA : A.Finite) (hAβ‚€ : A.Nonempty) {K : ℝ} (hAK : Nat.card (A + A) ≀ K * Nat.card A) : βˆƒ (H : AddSubgroup G) (c : Set G), c.Finite ∧ (H : Set G).Finite ∧ Nat.card c < 2 * K ^ 9 ∧ Nat.card H ≀ Nat.card A ∧ A βŠ† c + H := by sorry /-- **Marton's conjecture in abelian groups of bounded torsion**, `[GGMT2]`, Theorem 1.1. Let `G` be an abelian group of torsion `m β‰₯ 2`, meaning that `m β€’ x = 0` for every `x : G`. If `A` is a finite non-empty subset of `G` with `|A + A| ≀ K * |A|`, then `A` is covered by fewer than `m * K ^ (256 * m ^ 3 + 1)` cosets of a subgroup `H` of `G` with `|H| ≀ |A|`. The ambient group `G` is not required to be finite; the covering set `c` and the subgroup `H` produced are then finite. -/ theorem torsion_pfr_conjecture {G : Type*} [AddCommGroup G] {m : β„•} (hm : 2 ≀ m) (htorsion : βˆ€ x : G, m β€’ x = 0) {A : Set G} (hA : A.Finite) (hAβ‚€ : A.Nonempty) {K : ℝ} (hAK : Nat.card (A + A) ≀ K * Nat.card A) : βˆƒ (H : AddSubgroup G) (c : Set G), c.Finite ∧ (H : Set G).Finite ∧ Nat.card c < m * K ^ (256 * m ^ 3 + 1) ∧ Nat.card H ≀ Nat.card A ∧ A βŠ† c + H := by sorry /-- **Weak Marton's conjecture over the integers**, `[GGMT]`, Theorem 1.3. Let `G` be a finitely generated free `β„€`-module, that is, a copy of `β„€ ^ D`. If `A` is a finite non-empty subset of `G` with `|A + A| ≀ K * |A|`, then `A` has a subset `A'` with `|A'| β‰₯ K ^ (-34) * |A|` whose affine dimension β€” the rank of the `β„€`-span of its difference set β€” is at most `(80 / log 2) * log K`. This realises the constants `C₁ = 68` and `Cβ‚‚ = 80 / log 2` of `[GGMT]`, Theorem 1.3, which is stated there for unspecified absolute constants. -/ theorem weak_pfr_int {G : Type*} [AddCommGroup G] [Module.Free β„€ G] [Module.Finite β„€ G] {A : Set G} (hA : A.Finite) (hAβ‚€ : A.Nonempty) {K : ℝ} (hAK : Nat.card (A + A) ≀ K * Nat.card A) : βˆƒ A' βŠ† A, K ^ (-34 : ℝ) * Nat.card A ≀ Nat.card A' ∧ (Module.finrank β„€ (vectorSpan β„€ A') : ℝ) ≀ (80 / Real.log 2) * Real.log K := by sorry /-- **The homomorphism form of Marton's conjecture**, `[GGMT]`, Corollary 1.4. Let `G` and `G'` be finite abelian groups of exponent `2` and let `f : G β†’ G'` be a function whose additive defects `f (x + y) - f x - f y` all lie in a set `S`. Then `f` differs from a group homomorphism `Ο† : G β†’+ G'` by a function taking at most `|S| ^ 10` values. -/ theorem homomorphism_pfr {G G' : Type*} [AddCommGroup G] [AddCommGroup G'] [Finite G] [Finite G'] (h2 : βˆ€ x : G, 2 β€’ x = 0) (h2' : βˆ€ y : G', 2 β€’ y = 0) (f : G β†’ G') (S : Set G') (hS : βˆ€ x y : G, f (x + y) - f x - f y ∈ S) : βˆƒ (Ο† : G β†’+ G') (T : Set G'), Nat.card T ≀ Nat.card S ^ 10 ∧ βˆ€ x : G, f x - Ο† x ∈ T := by sorry /-- **The approximate homomorphism form of Marton's conjecture**, `[GGMT]`, Corollary 1.5. Let `G` and `G'` be finite abelian groups of exponent `2` and let `f : G β†’ G'` be a function such that `f (x + y) = f x + f y` for at least a proportion `K⁻¹` of the pairs `(x, y) ∈ G Γ— G`, written here as `|G| ^ 2 ≀ K * |{(x, y) | f (x + y) = f x + f y}|`. Then there is a group homomorphism `Ο† : G β†’+ G'` agreeing with `f` on at least `(|G| / (2 ^ 144 * K ^ 122) - 1) / 2` points of `G`. -/ theorem approx_hom_pfr {G G' : Type*} [AddCommGroup G] [AddCommGroup G'] [Finite G] [Finite G'] (h2 : βˆ€ x : G, 2 β€’ x = 0) (h2' : βˆ€ y : G', 2 β€’ y = 0) (f : G β†’ G') {K : ℝ} (hK : 0 < K) (hf : (Nat.card G : ℝ) ^ 2 ≀ K * Nat.card {x : G Γ— G | f (x.1 + x.2) = f x.1 + f x.2}) : βˆƒ Ο† : G β†’+ G', (Nat.card G / (2 ^ 144 * K ^ 122) - 1) / 2 ≀ Nat.card {x : G | f x = Ο† x} := by sorry end Marton