Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite Polygonal Set Elementary Complex

Definition
FinitePolygonalSetElementaryComplex

by moona3k · Oct 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

crossing-consequencestrellis-port

Let KKK be a finite polygonal set in the plane. An elementary complex refinement of KKK consists of a finite vertex set VVV and a finite edge set EEE of non-degenerate closed straight segments with the following properties. The vertex set is exactly the listed point set of KKK. The endpoints of every edge of EEE lie in VVV. Every edge of EEE is a consecutive subsegment of some raw listed segment of KKK, where that raw segment is cut at parameters 000, 111, and at every parameter whose image is a listed point of KKK. Each elementary edge is contained in its raw listed segment. No vertex of VVV lies in the relative interior of an elementary edge. Distinct elementary edges have disjoint relative interiors. Finally,

K=V∪⋃e∈Ee.K = V\cup\bigcup_{e\in E} e .K=V∪e∈E⋃​e.

Formalization Note This node is ported from the Trellis formalization of the crossing lemma and its consequences (wpegden/crossing-consequences, commit 8769d142, W. Pegden, Apache-2.0); the statement is the Trellis node FinitePolygonalSetElementaryComplex.

Definition code
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Combinatorics.SimpleGraph.Finite
import Mathlib.Data.Finset.Prod
import Mathlib.Data.Set.Finite.Basic
import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic
import Mathlib.Data.Finset.Sort
import Definitions.Def_FinitePolygonalSet

open Classical
noncomputable section

-- [TABLET NODE: FinitePolygonalSetElementaryComplex]
structure FinitePolygonalSetElementaryComplex (K : FinitePolygonalSet) where
-- BODY
  vertices : Finset (EuclideanSpace ℝ (Fin 2))
  edges : Finset (EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2))
  vertices_eq_points : vertices = K.points
  edge_source_mem :
    ∀ e : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges → e.1 ∈ vertices
  edge_target_mem :
    ∀ e : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges → e.2 ∈ vertices
  edge_nondegenerate :
    ∀ e : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges → e.1 ≠ e.2
  edge_consecutive_cut :
    ∀ e : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges →
        ∃ s : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
          s ∈ K.segments ∧
            ∃ L : List ℝ,
              L.Nodup ∧
                L.SortedLT ∧
                  (∀ t : ℝ, t ∈ L ↔
                    t = 0 ∨ t = 1 ∨
                      (0 ≤ t ∧ t ≤ 1 ∧
                        AffineMap.lineMap s.1 s.2 t ∈ K.points)) ∧
                    (0 : ℝ) ∈ L ∧
                      (1 : ℝ) ∈ L ∧
                        (∀ t : ℝ, t ∈ L → 0 ≤ t ∧ t ≤ 1) ∧
                          (∀ n (hn : n + 1 < L.length), L[n] < L[n + 1]) ∧
                            (∀ n (hn : n + 1 < L.length) t,
                              0 ≤ t → t ≤ 1 →
                                AffineMap.lineMap s.1 s.2 t ∈ K.points →
                                  ¬ (L[n] < t ∧ t < L[n + 1])) ∧
                              ∃ k, ∃ hk : k + 1 < L.length,
                                e.1 = AffineMap.lineMap s.1 s.2 L[k] ∧
                                  e.2 = AffineMap.lineMap s.1 s.2 L[k + 1]
  edge_subset_raw :
    ∀ e : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges →
        ∃ s : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
          s ∈ K.segments ∧ segment ℝ e.1 e.2 ⊆ segment ℝ s.1 s.2
  no_vertex_in_edge_interior :
    ∀ e : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges →
        ∀ v : EuclideanSpace ℝ (Fin 2),
          v ∈ vertices → v ∉ openSegment ℝ e.1 e.2
  edge_open_interiors_disjoint :
    ∀ e f : EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2),
      e ∈ edges → f ∈ edges → e ≠ f →
        Disjoint (openSegment ℝ e.1 e.2) (openSegment ℝ f.1 f.2)
  carrier_eq :
    K.carrier =
      (vertices : Set (EuclideanSpace ℝ (Fin 2))) ∪
        ⋃ e : {e // e ∈ edges}, segment ℝ e.1.1 e.1.2
Source
https://github.com/wpegden/crossing-consequences/blob/8769d142033fce042f502bf2857afb6b1375b5c3/Tablet/FinitePolygonalSetElementaryComplex.lean#L1-L62

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me