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

84 lines
3.1 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
/-!
# Affine incidence planes
Following Soergel's notes, an **affine incidence plane** is an incidence geometry
satisfying two additional axioms:
* the *parallel axiom*: through a point off a line there passes exactly one
parallel (disjoint) line;
* the *triangle axiom*: there exist three non-collinear points.
We introduce the relation `∥` ("equal or parallel") on the lines and prove that
it is an equivalence relation, the transitivity being a consequence of the
parallel axiom.
## Main definitions
* `AffineIncidencePlane X` : the structure of an affine incidence plane.
* `AffineIncidencePlane.Parallel` : the "equal or parallel" relation on lines.
-/
universe u
variable {X : Type u}
/-- An **affine incidence plane** is an incidence geometry in which through every
point off a line there passes exactly one disjoint line (the *parallel axiom*) and
in which a triangle exists. -/
structure AffineIncidencePlane (X : Type u) extends IncidenceGeometry X where
/-- Parallel axiom: through a point `x` not on a line `g` there is exactly one
line `h` disjoint from `g`. -/
unique_parallel : ∀ g ∈ lines, ∀ x ∉ g, ∃! h, h ∈ lines ∧ x ∈ h ∧ h ∩ g = ∅
/-- Triangle axiom: there exist three non-collinear points. -/
exists_triangle : ∃ a b c, toIncidenceGeometry.Triangle a b c
namespace AffineIncidencePlane
/-- Two lines are **parallel** (in the sense of "equal or parallel", written `∥`
in the source) if they coincide or are disjoint. -/
def Parallel (_P : AffineIncidencePlane X) (g h : Set X) : Prop :=
g = h ∨ g ∩ h = ∅
variable {P : AffineIncidencePlane X}
@[refl]
theorem parallel_refl (g : Set X) : P.Parallel g g := Or.inl rfl
theorem parallel_symm {g h : Set X} (hgh : P.Parallel g h) : P.Parallel h g := by
rcases hgh with h | h
· exact Or.inl h.symm
· exact Or.inr (by rw [Set.inter_comm]; exact h)
/-- Transitivity of parallelism for lines: this is where the parallel axiom is
used. If `g`, `h`, `k` are lines with `g ∥ h` and `h ∥ k`, then `g ∥ k`. -/
theorem parallel_trans {g h k : Set X} (hg : g ∈ P.lines) (hh : h ∈ P.lines)
(hk : k ∈ P.lines) (hgh : P.Parallel g h) (hhk : P.Parallel h k) :
P.Parallel g k := by
-- The cases where two of the lines coincide are immediate.
rcases hgh with rfl | hgh
· exact hhk
rcases hhk with rfl | hhk
· exact Or.inr hgh
-- Now `g ∩ h = ∅` and `h ∩ k = ∅`; we show `g = k` or `g ∩ k = ∅`.
by_cases hgk : g ∩ k = ∅
· exact Or.inr hgk
-- A common point `p` of `g` and `k` lies off `h`, so `g` and `k` are both the
-- unique parallel to `h` through `p`, whence `g = k`.
obtain ⟨p, hpg, hpk⟩ := Set.nonempty_iff_ne_empty.2 hgk
have hph : p ∉ h := fun hph => by
have : p ∈ g ∩ h := ⟨hpg, hph⟩
rw [hgh] at this; exact this
refine Or.inl ?_
have huniq := P.unique_parallel h hh p hph
refine huniq.unique ⟨hg, hpg, hgh⟩ ⟨hk, hpk, ?_⟩
rw [Set.inter_comm]; exact hhk
end AffineIncidencePlane