AFTD Auto-Formalizing Theoretical Domains

euclidean_avoidance_all_dimensions_lifts_to_inner_product_space

theoremverified

If every finite-dimensional real Euclidean space admits a two-coloring avoiding the specified false and true arithmetic progressions, then every real inner-product space admits such a coloring, with the same lengths and spacings.

Statement

theorem euclidean_avoidance_all_dimensions_lifts_to_inner_product_space (r m : ℕ) (α β : ℝ) (h : ∀ n : ℕ, euclidean_avoids_ap n r α m β) (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℝ H] : ∃ c : H → Bool, (¬ ∃ x v : H, ‖v‖ = α ∧ ∀ k : Fin r, c (x + (k.val : ℝ) • v) = false) ∧ (¬ ∃ x v : H, ‖v‖ = β ∧ ∀ k : Fin m, c (x + (k.val : ℝ) • v) = true)
Source
OP-1482; compactness reduction to one infinite-dimensional coloring
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • euclidean_avoids_apThe Euclidean Ramsey avoidance property euclidean_avoids_ap n r α M β (commonly denoted E^n ↛ (α ℓ_r, β ℓ_M)) asserts that there exists a…

The proof, explained

To lift the avoidance of monochromatic arithmetic progressions from Euclidean spaces to an arbitrary real inner product space H, we apply a topological compactness argument (a form of the De Bruijn-Erdős theorem). Each condition forbidding a monochromatic progression depends only on a finite support of points in H, and any finite family of such conditions involves points spanning a finite-dimensional subspace E. Since E is isometrically isomorphic to a Euclidean space, it admits an avoiding coloring, which extends to satisfy the finite family. By compactness of the space of 2-colorings under the product topology, all conditions can be satisfied simultaneously on H.

  1. Compactness lemma: if every finite subcollection of locally determined constraints is satisfiable, then all constraints are simultaneously satisfiable.

    We view Bool with the discrete topology, so the function space V → Bool is compact by Tychonoff's theorem. Each constraint P i f depends only on the values of f on the finite support of i, making the set of satisfying colorings closed (its complement is open as a union of cylinder sets). By the finite intersection property of compact spaces, the nonemptiness of intersections over all finite subsets implies the total intersection is nonempty, yielding a global coloring satisfying all constraints.

    lines 8–37

    uses isOpen_compl_iff, isOpen_iff_mem_nhds, isOpen_biInter_finset, continuous_apply, isOpen_discrete, Filter.mem_of_superset, CompactSpace.iInter_nonempty

      classical
      have hclosed (i : I) : IsClosed {f : V → Bool | P i f} := by
        rw [← isOpen_compl_iff]
        rw [isOpen_iff_mem_nhds]
        intro f hf
        let U : Set (V → Bool) := ⋂ x ∈ support i, {g | g x = f x}
        have hU : IsOpen U := by
          apply isOpen_biInter_finset
          intro x hx
          change IsOpen {g : V → Bool | g x = f x}
          have hEval : Continuous (fun g : V → Bool => g x) := continuous_apply x
          have hS : IsOpen ({f x} : Set Bool) := isOpen_discrete _
          exact hS.preimage hEval
        have hfU : f ∈ U := by simp [U]
        apply Filter.mem_of_superset (hU.mem_nhds hfU)
        intro g hg hpg
        apply hf
        apply (hlocal i g f ?_).mp hpg
        intro x hx
        have := hg
        simp only [U, mem_iInter, mem_setOf_eq] at this
        exact this x hx
      have hn : (⋂ i : I, {f : V → Bool | P i f}).Nonempty := by
        apply CompactSpace.iInter_nonempty hclosed
        intro s
        obtain ⟨f, hf⟩ := hfinite s
        refine ⟨f, ?_⟩
        simpa only [mem_iInter, mem_setOf_eq] using hf
      obtain ⟨f, hf⟩ := hn
      exact ⟨f, by simpa only [mem_iInter, mem_setOf_eq] using hf⟩
  2. The avoidance property transfers to any finite-dimensional real inner product space of dimension n.

    By choosing a standard orthonormal basis, the space H is isometrically isomorphic to EuclideanSpace ℝ (Fin n). Pulling back a valid coloring on Euclidean space along this linear isometry preserves norms of difference vectors and linear combinations, so H also avoids the specified monochromatic arithmetic progressions.

    lines 48–63

    uses stdOrthonormalBasis, map_add, map_smul

      classical
      let e := (stdOrthonormalBasis ℝ H).repr
      obtain ⟨c, hc0, hc1⟩ := h (Module.finrank ℝ H)
      refine ⟨fun x => c (e x), ?_, ?_⟩
      · rintro ⟨x, v, hv, hc⟩
        apply hc0
        refine ⟨e x, e v, ?_, ?_⟩
        · simpa [e] using hv
        · intro k
          simpa only [map_add, map_smul] using hc k
      · rintro ⟨x, v, hv, hc⟩
        apply hc1
        refine ⟨e x, e v, ?_, ?_⟩
        · simpa [e] using hv
        · intro k
          simpa only [map_add, map_smul] using hc k
  3. Formulate the avoidance conditions and establish that each condition depends on a finite support.

    Define an index set I indexing all potential forbidden progressions (false progressions of length r and spacing α, and true progressions of length m and spacing β). The predicate P i c asserts that the arithmetic progression at i is not monochromatic. Each constraint depends only on the values at the finitely many points of the progression, so P i f ↔ P i g whenever f and g agree on the support of i.

    lines 66–95

      classical
      let I := (H × H) ⊕ (H × H)
      let pt : I → H × H := Sum.elim id id
      let support : I → Finset H := fun i =>
        { (pt i).1, (pt i).2 } ∪ match i with
        | Sum.inl p => Finset.univ.image fun k : Fin r => p.1 + (k.val : ℝ) • p.2
        | Sum.inr p => Finset.univ.image fun k : Fin m => p.1 + (k.val : ℝ) • p.2
      let P : I → (H → Bool) → Prop := fun i c =>
        match i with
        | Sum.inl p => ‖p.2‖ = α → ¬ ∀ k : Fin r, c (p.1 + (k.val : ℝ) • p.2) = false
        | Sum.inr p => ‖p.2‖ = β → ¬ ∀ k : Fin m, c (p.1 + (k.val : ℝ) • p.2) = true
      have hlocal : ∀ i f g, (∀ x ∈ support i, f x = g x) → (P i f ↔ P i g) := by
        intro i f g hfg
        rcases i with ⟨x, v⟩ | ⟨x, v⟩
        · have heq : ∀ k : Fin r, f (x + (k.val : ℝ) • v) = g (x + (k.val : ℝ) • v) := by
            intro k
            apply hfg
            simp [support, pt]
          dsimp [P]
          constructor <;> intro hh hv hc <;> apply hh hv <;> intro k
          · rw [heq]; exact hc k
          · rw [← heq]; exact hc k
        · have heq : ∀ k : Fin m, f (x + (k.val : ℝ) • v) = g (x + (k.val : ℝ) • v) := by
            intro k
            apply hfg
            simp [support, pt]
          dsimp [P]
          constructor <;> intro hh hv hc <;> apply hh hv <;> intro k
          · rw [heq]; exact hc k
          · rw [← heq]; exact hc k
  4. Any finite subset of conditions is satisfiable on H.

    Given a finite set of conditions, the union of their supports is a finite subset S of H. The linear span E of S is a finite-dimensional subspace, which inherits the inner product space structure. By the finite-dimensional avoidance lemma, E admits a coloring avoiding monochromatic progressions. Extending this coloring to all of H by setting outside points to false satisfies all conditions in the finite set, since all relevant points lie in E.

    lines 96–136

    uses FiniteDimensional.span_finset, in931_finite_dimensional_avoidance, Submodule.subset_span

      have hfinite : ∀ s : Finset I, ∃ f, ∀ i ∈ s, P i f := by
        intro s
        let S : Finset H := s.biUnion support
        let E : Submodule ℝ H := Submodule.span ℝ (S : Set H)
        letI : FiniteDimensional ℝ E := FiniteDimensional.span_finset ℝ S
        obtain ⟨c, hc0, hc1⟩ := in931_finite_dimensional_avoidance r m α β h E
        let C : H → Bool := fun x => if hx : x ∈ E then c ⟨x, hx⟩ else false
        have hC (x : E) : C x = c x := by simp [C, x.property]
        refine ⟨C, ?_⟩
        intro i hi
        have hx : (pt i).1 ∈ E := by
          apply Submodule.subset_span
          simp only [S, Finset.mem_coe, Finset.mem_biUnion]
          refine ⟨i, hi, ?_⟩
          simp [support]
        have hv : (pt i).2 ∈ E := by
          apply Submodule.subset_span
          simp only [S, Finset.mem_coe, Finset.mem_biUnion]
          refine ⟨i, hi, ?_⟩
          simp [support]
        rcases i with ⟨x, v⟩ | ⟨x, v⟩
        · dsimp [pt] at hx hv
          dsimp [P]
          intro hnorm hm
          apply hc0
          refine ⟨⟨x, hx⟩, ⟨v, hv⟩, ?_, ?_⟩
          · exact hnorm
          · intro k
            have hh := hm k
            change C (((⟨x, hx⟩ : E) + (k.val : ℝ) • ⟨v, hv⟩ : E) : H) = false at hh
            simpa only [hC] using hh
        · dsimp [pt] at hx hv
          dsimp [P]
          intro hnorm hm
          apply hc1
          refine ⟨⟨x, hx⟩, ⟨v, hv⟩, ?_, ?_⟩
          · exact hnorm
          · intro k
            have hh := hm k
            change C (((⟨x, hx⟩ : E) + (k.val : ℝ) • ⟨v, hv⟩ : E) : H) = true at hh
            simpa only [hC] using hh
  5. A global avoiding coloring exists on H.

    Applying the compactness theorem in931_finite_coloring_compactness to the constraints P gives a coloring c on H satisfying all conditions. Unpacking these conditions shows that c avoids length-r progressions of spacing α colored false and length-m progressions of spacing β colored true.

    lines 137–142

    uses in931_finite_coloring_compactness

      obtain ⟨c, hc⟩ := in931_finite_coloring_compactness H I P support hlocal hfinite
      refine ⟨c, ?_, ?_⟩
      · rintro ⟨x, v, hv, hm⟩
        exact hc (Sum.inl (x, v)) hv hm
      · rintro ⟨x, v, hv, hm⟩
        exact hc (Sum.inr (x, v)) hv hm

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

open Setprivate theorem in931_finite_coloring_compactness    (V I : Type*) (P : I → (V → Bool) → Prop) (support : I → Finset V)    (hlocal : ∀ i f g, (∀ x ∈ support i, f x = g x) → (P i f ↔ P i g))    (hfinite : ∀ s : Finset I, ∃ f, ∀ i ∈ s, P i f) :    ∃ f, ∀ i, P i f := by  classical  have hclosed (i : I) : IsClosed {f : V → Bool | P i f} := by    rw [← isOpen_compl_iff]    rw [isOpen_iff_mem_nhds]    intro f hf    let U : Set (V → Bool) := ⋂ x ∈ support i, {g | g x = f x}    have hU : IsOpen U := by      apply isOpen_biInter_finset      intro x hx      change IsOpen {g : V → Bool | g x = f x}      have hEval : Continuous (fun g : V → Bool => g x) := continuous_apply x      have hS : IsOpen ({f x} : Set Bool) := isOpen_discrete _      exact hS.preimage hEval    have hfU : f ∈ U := by simp [U]    apply Filter.mem_of_superset (hU.mem_nhds hfU)    intro g hg hpg    apply hf    apply (hlocal i g f ?_).mp hpg    intro x hx    have := hg    simp only [U, mem_iInter, mem_setOf_eq] at this    exact this x hx  have hn : (⋂ i : I, {f : V → Bool | P i f}).Nonempty := by    apply CompactSpace.iInter_nonempty hclosed    intro s    obtain ⟨f, hf⟩ := hfinite s    refine ⟨f, ?_⟩    simpa only [mem_iInter, mem_setOf_eq] using hf  obtain ⟨f, hf⟩ := hn  exact ⟨f, by simpa only [mem_iInter, mem_setOf_eq] using hf⟩private theorem in931_finite_dimensional_avoidance    (r m : ℕ) (α β : ℝ)    (h : ∀ n : ℕ, euclidean_avoids_ap n r α m β)    (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℝ H] [FiniteDimensional ℝ H] :    ∃ c : H → Bool,      (¬ ∃ x v : H, ‖v‖ = α ∧ ∀ k : Fin r, c (x + (k.val : ℝ) • v) = false) ∧      (¬ ∃ x v : H, ‖v‖ = β ∧ ∀ k : Fin m, c (x + (k.val : ℝ) • v) = true) := by  classical  let e := (stdOrthonormalBasis ℝ H).repr  obtain ⟨c, hc0, hc1⟩ := h (Module.finrank ℝ H)  refine ⟨fun x => c (e x), ?_, ?_⟩  · rintro ⟨x, v, hv, hc⟩    apply hc0    refine ⟨e x, e v, ?_, ?_⟩    · simpa [e] using hv    · intro k      simpa only [map_add, map_smul] using hc k  · rintro ⟨x, v, hv, hc⟩    apply hc1    refine ⟨e x, e v, ?_, ?_⟩    · simpa [e] using hv    · intro k      simpa only [map_add, map_smul] using hc ktheorem euclidean_avoidance_all_dimensions_lifts_to_inner_product_space (r m : ℕ) (α β : ℝ) (h : ∀ n : ℕ, euclidean_avoids_ap n r α m β) (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℝ H] : ∃ c : H → Bool, (¬ ∃ x v : H, ‖v‖ = α ∧ ∀ k : Fin r, c (x + (k.val : ℝ) • v) = false) ∧ (¬ ∃ x v : H, ‖v‖ = β ∧ ∀ k : Fin m, c (x + (k.val : ℝ) • v) = true) := by  classical  let I := (H × H) ⊕ (H × H)  let pt : I → H × H := Sum.elim id id  let support : I → Finset H := fun i =>    { (pt i).1, (pt i).2 } ∪ match i with    | Sum.inl p => Finset.univ.image fun k : Fin r => p.1 + (k.val : ℝ) • p.2    | Sum.inr p => Finset.univ.image fun k : Fin m => p.1 + (k.val : ℝ) • p.2  let P : I → (H → Bool) → Prop := fun i c =>    match i with    | Sum.inl p => ‖p.2‖ = α → ¬ ∀ k : Fin r, c (p.1 + (k.val : ℝ) • p.2) = false    | Sum.inr p => ‖p.2‖ = β → ¬ ∀ k : Fin m, c (p.1 + (k.val : ℝ) • p.2) = true  have hlocal : ∀ i f g, (∀ x ∈ support i, f x = g x) → (P i f ↔ P i g) := by    intro i f g hfg    rcases i with ⟨x, v⟩ | ⟨x, v⟩    · have heq : ∀ k : Fin r, f (x + (k.val : ℝ) • v) = g (x + (k.val : ℝ) • v) := by        intro k        apply hfg        simp [support, pt]      dsimp [P]      constructor <;> intro hh hv hc <;> apply hh hv <;> intro k      · rw [heq]; exact hc k      · rw [← heq]; exact hc k    · have heq : ∀ k : Fin m, f (x + (k.val : ℝ) • v) = g (x + (k.val : ℝ) • v) := by        intro k        apply hfg        simp [support, pt]      dsimp [P]      constructor <;> intro hh hv hc <;> apply hh hv <;> intro k      · rw [heq]; exact hc k      · rw [← heq]; exact hc k  have hfinite : ∀ s : Finset I, ∃ f, ∀ i ∈ s, P i f := by    intro s    let S : Finset H := s.biUnion support    let E : Submodule ℝ H := Submodule.span ℝ (S : Set H)    letI : FiniteDimensional ℝ E := FiniteDimensional.span_finset ℝ S    obtain ⟨c, hc0, hc1⟩ := in931_finite_dimensional_avoidance r m α β h E    let C : H → Bool := fun x => if hx : x ∈ E then c ⟨x, hx⟩ else false    have hC (x : E) : C x = c x := by simp [C, x.property]    refine ⟨C, ?_⟩    intro i hi    have hx : (pt i).1 ∈ E := by      apply Submodule.subset_span      simp only [S, Finset.mem_coe, Finset.mem_biUnion]      refine ⟨i, hi, ?_⟩      simp [support]    have hv : (pt i).2 ∈ E := by      apply Submodule.subset_span      simp only [S, Finset.mem_coe, Finset.mem_biUnion]      refine ⟨i, hi, ?_⟩      simp [support]    rcases i with ⟨x, v⟩ | ⟨x, v⟩    · dsimp [pt] at hx hv      dsimp [P]      intro hnorm hm      apply hc0      refine ⟨⟨x, hx⟩, ⟨v, hv⟩, ?_, ?_⟩      · exact hnorm      · intro k        have hh := hm k        change C (((⟨x, hx⟩ : E) + (k.val : ℝ) • ⟨v, hv⟩ : E) : H) = false at hh        simpa only [hC] using hh    · dsimp [pt] at hx hv      dsimp [P]      intro hnorm hm      apply hc1      refine ⟨⟨x, hx⟩, ⟨v, hv⟩, ?_, ?_⟩      · exact hnorm      · intro k        have hh := hm k        change C (((⟨x, hx⟩ : E) + (k.val : ℝ) • ⟨v, hv⟩ : E) : H) = true at hh        simpa only [hC] using hh  obtain ⟨c, hc⟩ := in931_finite_coloring_compactness H I P support hlocal hfinite  refine ⟨c, ?_, ?_⟩  · rintro ⟨x, v, hv, hm⟩    exact hc (Sum.inl (x, v)) hv hm  · rintro ⟨x, v, hv, hm⟩    exact hc (Sum.inr (x, v)) hv hm
See it in the graphDiscuss this resultChallenge it