Files
elementarGeometrie/ElementarGeometrie/Incidence/Betweenness.lean
T
Stefan Kebekus b20e936d11
Lean Action CI / build (push) Has been cancelled
Working
2026-06-24 13:46:07 +02:00

92 lines
3.9 KiB
Lean4
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/-
Copyright (c) 2026 Stefan Kebekus. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Stefan Kebekus
-/
import ElementarGeometrie.Incidence.Basic
/-!
# Betweenness relations
Following Soergel's notes, this file adds a *betweenness relation*
(`Zwischenrelation`) to an incidence geometry. A betweenness relation is a set
`Z ⊆ X³` of collinear triples that admits *compatible orderings* on every line
and satisfies *Pasch's axiom*.
From a betweenness relation we obtain *segments* `[p, q]` and *rays* (half-lines).
## Main definitions
* `IsLinearOrderOn` : a relation that is a linear order when restricted to a set.
* `CompatibleOrder` : a linear order on a line inducing the given betweenness.
* `BetweennessRelation` : a betweenness relation on an incidence geometry.
* `BetweennessRelation.segment` : the segment with given endpoints.
* `BetweennessRelation.IsRay` : the predicate of being a half-line.
-/
universe u
variable {X : Type u}
namespace IncidenceGeometry
/-- A relation `le` is a **linear order on the set `g`** if it is reflexive,
transitive, antisymmetric and total on the points of `g`. We phrase the order as
a relation on all of `X` but only constrain it on `g`. -/
structure IsLinearOrderOn (g : Set X) (le : X X Prop) : Prop where
refl : x g, le x x
trans : x g, y g, z g, le x y le y z le x z
antisymm : x g, y g, le x y le y x x = y
total : x g, y g, le x y le y x
/-- A linear order `le` on the line `g` is **compatible** with the set of triples
`Z` if, for points of `g`, betweenness is exactly "lies non-strictly between in
the order `le`", in either direction. -/
def CompatibleOrder (Z : Set (X × X × X)) (g : Set X) (le : X X Prop) : Prop :=
IsLinearOrderOn g le
x g, y g, z g,
((x, y, z) Z (le x y le y z) (le z y le y x))
/-- A **betweenness relation** on an incidence geometry `G` is a set `between` of
triples of points such that
* every triple in `between` is collinear;
* every line carries a linear order compatible with `between`
(*compatible orderings*);
* *Pasch's axiom* holds: for any three points `p, q, r`, every line meets either
none or at least two of the three segments `[p, q]`, `[q, r]`, `[r, p]`.
The segment `[p, q]` used in Pasch's axiom is `{x | (p, x, q) ∈ between}`. -/
structure BetweennessRelation (G : IncidenceGeometry X) where
/-- The set of triples `(x, y, z)` with `y` lying between `x` and `z`. -/
between : Set (X × X × X)
/-- Every triple in `between` consists of collinear points. -/
collinear : t between, G.Collinear {t.1, t.2.1, t.2.2}
/-- Every line carries a linear order compatible with the betweenness. -/
compatible_order : g G.lines, le, CompatibleOrder between g le
/-- Pasch's axiom: every line meets none or at least two of the three segments
spanned by any three points. -/
pasch : p q r : X, g G.lines,
let meets := fun a b => (g {x | (a, x, b) between}).Nonempty
(meets p q meets q r meets r p)
(meets p q meets q r) (meets q r meets r p) (meets p q meets r p)
namespace BetweennessRelation
variable {G : IncidenceGeometry X} (Z : BetweennessRelation G)
/-- The **segment** with endpoints `p` and `q` is the set of points lying between
`p` and `q`. In this terminology a one-point segment `[p, p] = {p}` is allowed. -/
def segment (p q : X) : Set X := {x | (p, x, q) Z.between}
/-- A subset `A ⊆ X` is a **ray** (half-line) if there is a line `g`, a point
`p ∈ g`, and a linear order on `g` compatible with the betweenness, such that
`A` is the set of points of `g` not exceeding `p`. -/
def IsRay (A : Set X) : Prop :=
g G.lines, p g, le, CompatibleOrder Z.between g le
A = {x | x g le x p}
end BetweennessRelation
end IncidenceGeometry