Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2021 Thomas Browning. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Thomas Browning | |
-/ | |
import algebra.big_operators.order | |
import combinatorics.hall.basic | |
import data.fintype.card | |
import set_theory.cardinal.finite | |
/-! | |
# Configurations of Points and lines | |
This file introduces abstract configurations of points and lines, and proves some basic properties. | |
## Main definitions | |
* `configuration.nondegenerate`: Excludes certain degenerate configurations, | |
and imposes uniqueness of intersection points. | |
* `configuration.has_points`: A nondegenerate configuration in which | |
every pair of lines has an intersection point. | |
* `configuration.has_lines`: A nondegenerate configuration in which | |
every pair of points has a line through them. | |
* `configuration.line_count`: The number of lines through a given point. | |
* `configuration.point_count`: The number of lines through a given line. | |
## Main statements | |
* `configuration.has_lines.card_le`: `has_lines` implies `|P| β€ |L|`. | |
* `configuration.has_points.card_le`: `has_points` implies `|L| β€ |P|`. | |
* `configuration.has_lines.has_points`: `has_lines` and `|P| = |L|` implies `has_points`. | |
* `configuration.has_points.has_lines`: `has_points` and `|P| = |L|` implies `has_lines`. | |
Together, these four statements say that any two of the following properties imply the third: | |
(a) `has_lines`, (b) `has_points`, (c) `|P| = |L|`. | |
-/ | |
open_locale big_operators | |
namespace configuration | |
universe u | |
variables (P L : Type u) [has_mem P L] | |
/-- A type synonym. -/ | |
def dual := P | |
instance [this : inhabited P] : inhabited (dual P) := this | |
instance [this : fintype P] : fintype (dual P) := this | |
instance : has_mem (dual L) (dual P) := | |
β¨function.swap (has_mem.mem : P β L β Prop)β© | |
/-- A configuration is nondegenerate if: | |
1) there does not exist a line that passes through all of the points, | |
2) there does not exist a point that is on all of the lines, | |
3) there is at most one line through any two points, | |
4) any two lines have at most one intersection point. | |
Conditions 3 and 4 are equivalent. -/ | |
class nondegenerate : Prop := | |
(exists_point : β l : L, β p, p β l) | |
(exists_line : β p, β l : L, p β l) | |
(eq_or_eq : β {pβ pβ : P} {lβ lβ : L}, pβ β lβ β pβ β lβ β pβ β lβ β pβ β lβ β pβ = pβ β¨ lβ = lβ) | |
/-- A nondegenerate configuration in which every pair of lines has an intersection point. -/ | |
class has_points extends nondegenerate P L : Type u := | |
(mk_point : β {lβ lβ : L} (h : lβ β lβ), P) | |
(mk_point_ax : β {lβ lβ : L} (h : lβ β lβ), mk_point h β lβ β§ mk_point h β lβ) | |
/-- A nondegenerate configuration in which every pair of points has a line through them. -/ | |
class has_lines extends nondegenerate P L : Type u := | |
(mk_line : β {pβ pβ : P} (h : pβ β pβ), L) | |
(mk_line_ax : β {pβ pβ : P} (h : pβ β pβ), pβ β mk_line h β§ pβ β mk_line h) | |
open nondegenerate has_points has_lines | |
instance [nondegenerate P L] : nondegenerate (dual L) (dual P) := | |
{ exists_point := @exists_line P L _ _, | |
exists_line := @exists_point P L _ _, | |
eq_or_eq := Ξ» lβ lβ pβ pβ hβ hβ hβ hβ, (@eq_or_eq P L _ _ pβ pβ lβ lβ hβ hβ hβ hβ).symm } | |
instance [has_points P L] : has_lines (dual L) (dual P) := | |
{ mk_line := @mk_point P L _ _, | |
mk_line_ax := Ξ» _ _, mk_point_ax } | |
instance [has_lines P L] : has_points (dual L) (dual P) := | |
{ mk_point := @mk_line P L _ _, | |
mk_point_ax := Ξ» _ _, mk_line_ax } | |
lemma has_points.exists_unique_point [has_points P L] (lβ lβ : L) (hl : lβ β lβ) : | |
β! p, p β lβ β§ p β lβ := | |
β¨mk_point hl, mk_point_ax hl, | |
Ξ» p hp, (eq_or_eq hp.1 (mk_point_ax hl).1 hp.2 (mk_point_ax hl).2).resolve_right hlβ© | |
lemma has_lines.exists_unique_line [has_lines P L] (pβ pβ : P) (hp : pβ β pβ) : | |
β! l : L, pβ β l β§ pβ β l := | |
has_points.exists_unique_point (dual L) (dual P) pβ pβ hp | |
variables {P L} | |
/-- If a nondegenerate configuration has at least as many points as lines, then there exists | |
an injective function `f` from lines to points, such that `f l` does not lie on `l`. -/ | |
lemma nondegenerate.exists_injective_of_card_le [nondegenerate P L] | |
[fintype P] [fintype L] (h : fintype.card L β€ fintype.card P) : | |
β f : L β P, function.injective f β§ β l, (f l) β l := | |
begin | |
classical, | |
let t : L β finset P := Ξ» l, (set.to_finset {p | p β l}), | |
suffices : β s : finset L, s.card β€ (s.bUnion t).card, -- Hall's marriage theorem | |
{ obtain β¨f, hf1, hf2β© := (finset.all_card_le_bUnion_card_iff_exists_injective t).mp this, | |
exact β¨f, hf1, Ξ» l, set.mem_to_finset.mp (hf2 l)β© }, | |
intro s, | |
by_cases hsβ : s.card = 0, -- If `s = β `, then `s.card = 0 β€ (s.bUnion t).card` | |
{ simp_rw [hsβ, zero_le] }, | |
by_cases hsβ : s.card = 1, -- If `s = {l}`, then pick a point `p β l` | |
{ obtain β¨l, rflβ© := finset.card_eq_one.mp hsβ, | |
obtain β¨p, hlβ© := exists_point l, | |
rw [finset.card_singleton, finset.singleton_bUnion, nat.one_le_iff_ne_zero], | |
exact finset.card_ne_zero_of_mem (set.mem_to_finset.mpr hl) }, | |
suffices : (s.bUnion t)αΆ.card β€ sαΆ.card, -- Rephrase in terms of complements (uses `h`) | |
{ rw [finset.card_compl, finset.card_compl, tsub_le_iff_left] at this, | |
replace := h.trans this, | |
rwa [βadd_tsub_assoc_of_le s.card_le_univ, le_tsub_iff_left | |
(le_add_left s.card_le_univ), add_le_add_iff_right] at this }, | |
have hsβ : (s.bUnion t)αΆ.card β€ 1, -- At most one line through two points of `s` | |
{ refine finset.card_le_one_iff.mpr (Ξ» pβ pβ hpβ hpβ, _), | |
simp_rw [finset.mem_compl, finset.mem_bUnion, exists_prop, not_exists, not_and, | |
set.mem_to_finset, set.mem_set_of_eq, not_not] at hpβ hpβ, | |
obtain β¨lβ, lβ, hlβ, hlβ, hlββ© := | |
finset.one_lt_card_iff.mp (nat.one_lt_iff_ne_zero_and_ne_one.mpr β¨hsβ, hsββ©), | |
exact (eq_or_eq (hpβ lβ hlβ) (hpβ lβ hlβ) (hpβ lβ hlβ) (hpβ lβ hlβ)).resolve_right hlβ }, | |
by_cases hsβ : sαΆ.card = 0, | |
{ rw [hsβ, nat.le_zero_iff], | |
rw [finset.card_compl, tsub_eq_zero_iff_le, has_le.le.le_iff_eq (finset.card_le_univ _), | |
eq_comm, finset.card_eq_iff_eq_univ] at hsβ β’, | |
rw hsβ, | |
rw finset.eq_univ_iff_forall at hsβ β’, | |
exact Ξ» p, exists.elim (exists_line p) -- If `s = univ`, then show `s.bUnion t = univ` | |
(Ξ» l hl, finset.mem_bUnion.mpr β¨l, finset.mem_univ l, set.mem_to_finset.mpr hlβ©) }, | |
{ exact hsβ.trans (nat.one_le_iff_ne_zero.mpr hsβ) }, -- If `s < univ`, then consequence of `hsβ` | |
end | |
variables {P} (L) | |
/-- Number of points on a given line. -/ | |
noncomputable def line_count (p : P) : β := nat.card {l : L // p β l} | |
variables (P) {L} | |
/-- Number of lines through a given point. -/ | |
noncomputable def point_count (l : L) : β := nat.card {p : P // p β l} | |
variables (P L) | |
lemma sum_line_count_eq_sum_point_count [fintype P] [fintype L] : | |
β p : P, line_count L p = β l : L, point_count P l := | |
begin | |
classical, | |
simp only [line_count, point_count, nat.card_eq_fintype_card, βfintype.card_sigma], | |
apply fintype.card_congr, | |
calc (Ξ£ p, {l : L // p β l}) β {x : P Γ L // x.1 β x.2} : | |
(equiv.subtype_prod_equiv_sigma_subtype (β)).symm | |
... β {x : L Γ P // x.2 β x.1} : (equiv.prod_comm P L).subtype_equiv (Ξ» x, iff.rfl) | |
... β (Ξ£ l, {p // p β l}) : equiv.subtype_prod_equiv_sigma_subtype (Ξ» (l : L) (p : P), p β l), | |
end | |
variables {P L} | |
lemma has_lines.point_count_le_line_count [has_lines P L] {p : P} {l : L} (h : p β l) | |
[fintype {l : L // p β l}] : point_count P l β€ line_count L p := | |
begin | |
by_cases hf : infinite {p : P // p β l}, | |
{ exactI (le_of_eq nat.card_eq_zero_of_infinite).trans (zero_le (line_count L p)) }, | |
haveI := fintype_of_not_infinite hf, | |
rw [line_count, point_count, nat.card_eq_fintype_card, nat.card_eq_fintype_card], | |
have : β p' : {p // p β l}, p β p' := Ξ» p' hp', h ((congr_arg (β l) hp').mpr p'.2), | |
exact fintype.card_le_of_injective (Ξ» p', β¨mk_line (this p'), (mk_line_ax (this p')).1β©) | |
(Ξ» pβ pβ hp, subtype.ext ((eq_or_eq pβ.2 pβ.2 (mk_line_ax (this pβ)).2 | |
((congr_arg _ (subtype.ext_iff.mp hp)).mpr (mk_line_ax (this pβ)).2)).resolve_right | |
(Ξ» h', (congr_arg _ h').mp h (mk_line_ax (this pβ)).1))), | |
end | |
lemma has_points.line_count_le_point_count [has_points P L] {p : P} {l : L} (h : p β l) | |
[hf : fintype {p : P // p β l}] : line_count L p β€ point_count P l := | |
@has_lines.point_count_le_line_count (dual L) (dual P) _ _ l p h hf | |
variables (P L) | |
/-- If a nondegenerate configuration has a unique line through any two points, then `|P| β€ |L|`. -/ | |
lemma has_lines.card_le [has_lines P L] [fintype P] [fintype L] : | |
fintype.card P β€ fintype.card L := | |
begin | |
classical, | |
by_contradiction hcβ, | |
obtain β¨f, hfβ, hfββ© := nondegenerate.exists_injective_of_card_le (le_of_not_le hcβ), | |
have := calc β p, line_count L p = β l, point_count P l : sum_line_count_eq_sum_point_count P L | |
... β€ β l, line_count L (f l) : | |
finset.sum_le_sum (Ξ» l hl, has_lines.point_count_le_line_count (hfβ l)) | |
... = β p in finset.univ.image f, line_count L p : | |
finset.sum_bij (Ξ» l hl, f l) (Ξ» l hl, finset.mem_image_of_mem f hl) (Ξ» l hl, rfl) | |
(Ξ» lβ lβ hlβ hlβ hlβ, hfβ hlβ) (Ξ» p, by simp_rw [finset.mem_image, eq_comm, imp_self]) | |
... < β p, line_count L p : _, | |
{ exact lt_irrefl _ this }, | |
{ obtain β¨p, hpβ© := not_forall.mp (mt (fintype.card_le_of_surjective f) hcβ), | |
refine finset.sum_lt_sum_of_subset ((finset.univ.image f).subset_univ) (finset.mem_univ p) | |
_ _ (Ξ» p hpβ hpβ, zero_le (line_count L p)), | |
{ simpa only [finset.mem_image, exists_prop, finset.mem_univ, true_and] }, | |
{ rw [line_count, nat.card_eq_fintype_card, fintype.card_pos_iff], | |
obtain β¨l, hlβ© := @exists_line P L _ _ p, | |
exact let this := not_exists.mp hp l in β¨β¨mk_line this, (mk_line_ax this).2β©β© } }, | |
end | |
/-- If a nondegenerate configuration has a unique point on any two lines, then `|L| β€ |P|`. -/ | |
lemma has_points.card_le [has_points P L] [fintype P] [fintype L] : | |
fintype.card L β€ fintype.card P := | |
@has_lines.card_le (dual L) (dual P) _ _ _ _ | |
variables {P L} | |
lemma has_lines.exists_bijective_of_card_eq [has_lines P L] | |
[fintype P] [fintype L] (h : fintype.card P = fintype.card L) : | |
β f : L β P, function.bijective f β§ β l, point_count P l = line_count L (f l) := | |
begin | |
classical, | |
obtain β¨f, hf1, hf2β© := nondegenerate.exists_injective_of_card_le (ge_of_eq h), | |
have hf3 := (fintype.bijective_iff_injective_and_card f).mpr β¨hf1, h.symmβ©, | |
refine β¨f, hf3, Ξ» l, (finset.sum_eq_sum_iff_of_le | |
(by exact Ξ» l hl, has_lines.point_count_le_line_count (hf2 l))).mp | |
((sum_line_count_eq_sum_point_count P L).symm.trans ((finset.sum_bij (Ξ» l hl, f l) | |
(Ξ» l hl, finset.mem_univ (f l)) (Ξ» l hl, refl (line_count L (f l))) | |
(Ξ» lβ lβ hlβ hlβ hl, hf1 hl) (Ξ» p hp, _)).symm)) l (finset.mem_univ l)β©, | |
obtain β¨l, rflβ© := hf3.2 p, | |
exact β¨l, finset.mem_univ l, rflβ©, | |
end | |
lemma has_lines.line_count_eq_point_count [has_lines P L] [fintype P] [fintype L] | |
(hPL : fintype.card P = fintype.card L) {p : P} {l : L} (hpl : p β l) : | |
line_count L p = point_count P l := | |
begin | |
classical, | |
obtain β¨f, hf1, hf2β© := has_lines.exists_bijective_of_card_eq hPL, | |
let s : finset (P Γ L) := set.to_finset {i | i.1 β i.2}, | |
have step1 : β i : P Γ L, line_count L i.1 = β i : P Γ L, point_count P i.2, | |
{ rw [βfinset.univ_product_univ, finset.sum_product_right, finset.sum_product], | |
simp_rw [finset.sum_const, finset.card_univ, hPL, sum_line_count_eq_sum_point_count] }, | |
have step2 : β i in s, line_count L i.1 = β i in s, point_count P i.2, | |
{ rw [s.sum_finset_product finset.univ (Ξ» p, set.to_finset {l | p β l})], | |
rw [s.sum_finset_product_right finset.univ (Ξ» l, set.to_finset {p | p β l})], | |
refine (finset.sum_bij (Ξ» l hl, f l) (Ξ» l hl, finset.mem_univ (f l)) (Ξ» l hl, _) | |
(Ξ» _ _ _ _ h, hf1.1 h) (Ξ» p hp, _)).symm, | |
{ simp_rw [finset.sum_const, set.to_finset_card, βnat.card_eq_fintype_card], | |
change (point_count P l) β’ (point_count P l) = (line_count L (f l)) β’ (line_count L (f l)), | |
rw hf2 }, | |
{ obtain β¨l, hlβ© := hf1.2 p, | |
exact β¨l, finset.mem_univ l, hl.symmβ© }, | |
all_goals { simp_rw [finset.mem_univ, true_and, set.mem_to_finset], exact Ξ» p, iff.rfl } }, | |
have step3 : β i in sαΆ, line_count L i.1 = β i in sαΆ, point_count P i.2, | |
{ rwa [βs.sum_add_sum_compl, βs.sum_add_sum_compl, step2, add_left_cancel_iff] at step1 }, | |
rw β set.to_finset_compl at step3, | |
exact ((finset.sum_eq_sum_iff_of_le (by exact Ξ» i hi, has_lines.point_count_le_line_count | |
(set.mem_to_finset.mp hi))).mp step3.symm (p, l) (set.mem_to_finset.mpr hpl)).symm, | |
end | |
lemma has_points.line_count_eq_point_count [has_points P L] [fintype P] [fintype L] | |
(hPL : fintype.card P = fintype.card L) {p : P} {l : L} (hpl : p β l) : | |
line_count L p = point_count P l := | |
(@has_lines.line_count_eq_point_count (dual L) (dual P) _ _ _ _ hPL.symm l p hpl).symm | |
/-- If a nondegenerate configuration has a unique line through any two points, and if `|P| = |L|`, | |
then there is a unique point on any two lines. -/ | |
noncomputable def has_lines.has_points [has_lines P L] [fintype P] [fintype L] | |
(h : fintype.card P = fintype.card L) : has_points P L := | |
let this : β lβ lβ : L, lβ β lβ β β p : P, p β lβ β§ p β lβ := Ξ» lβ lβ hl, begin | |
classical, | |
obtain β¨f, hf1, hf2β© := has_lines.exists_bijective_of_card_eq h, | |
haveI : nontrivial L := β¨β¨lβ, lβ, hlβ©β©, | |
haveI := fintype.one_lt_card_iff_nontrivial.mp ((congr_arg _ h).mpr fintype.one_lt_card), | |
have hβ : β p : P, 0 < line_count L p := Ξ» p, exists.elim (exists_ne p) (Ξ» q hq, (congr_arg _ | |
nat.card_eq_fintype_card).mpr (fintype.card_pos_iff.mpr β¨β¨mk_line hq, (mk_line_ax hq).2β©β©)), | |
have hβ : β l : L, 0 < point_count P l := Ξ» l, (congr_arg _ (hf2 l)).mpr (hβ (f l)), | |
obtain β¨p, hlββ© := fintype.card_pos_iff.mp ((congr_arg _ nat.card_eq_fintype_card).mp (hβ lβ)), | |
by_cases hlβ : p β lβ, exact β¨p, hlβ, hlββ©, | |
have key' : fintype.card {q : P // q β lβ} = fintype.card {l : L // p β l}, | |
{ exact ((has_lines.line_count_eq_point_count h hlβ).trans nat.card_eq_fintype_card).symm.trans | |
nat.card_eq_fintype_card, }, | |
have : β q : {q // q β lβ}, p β q := Ξ» q hq, hlβ ((congr_arg (β lβ) hq).mpr q.2), | |
let f : {q : P // q β lβ} β {l : L // p β l} := Ξ» q, β¨mk_line (this q), (mk_line_ax (this q)).1β©, | |
have hf : function.injective f := Ξ» qβ qβ hq, subtype.ext ((eq_or_eq qβ.2 qβ.2 | |
(mk_line_ax (this qβ)).2 ((congr_arg _ (subtype.ext_iff.mp hq)).mpr (mk_line_ax | |
(this qβ)).2)).resolve_right (Ξ» h, (congr_arg _ h).mp hlβ (mk_line_ax (this qβ)).1)), | |
have key' := ((fintype.bijective_iff_injective_and_card f).mpr β¨hf, key'β©).2, | |
obtain β¨q, hqβ© := key' β¨lβ, hlββ©, | |
exact β¨q, (congr_arg _ (subtype.ext_iff.mp hq)).mp (mk_line_ax (this q)).2, q.2β©, | |
end in | |
{ mk_point := Ξ» lβ lβ hl, classical.some (this lβ lβ hl), | |
mk_point_ax := Ξ» lβ lβ hl, classical.some_spec (this lβ lβ hl) } | |
/-- If a nondegenerate configuration has a unique point on any two lines, and if `|P| = |L|`, | |
then there is a unique line through any two points. -/ | |
noncomputable def has_points.has_lines [has_points P L] [fintype P] [fintype L] | |
(h : fintype.card P = fintype.card L) : has_lines P L := | |
let this := @has_lines.has_points (dual L) (dual P) _ _ _ _ h.symm in | |
{ mk_line := this.mk_point, | |
mk_line_ax := this.mk_point_ax } | |
variables (P L) | |
/-- A projective plane is a nondegenerate configuration in which every pair of lines has | |
an intersection point, every pair of points has a line through them, | |
and which has three points in general position. -/ | |
class projective_plane extends nondegenerate P L : Type u := | |
(mk_point : β {lβ lβ : L} (h : lβ β lβ), P) | |
(mk_point_ax : β {lβ lβ : L} (h : lβ β lβ), mk_point h β lβ β§ mk_point h β lβ) | |
(mk_line : β {pβ pβ : P} (h : pβ β pβ), L) | |
(mk_line_ax : β {pβ pβ : P} (h : pβ β pβ), pβ β mk_line h β§ pβ β mk_line h) | |
(exists_config : β (pβ pβ pβ : P) (lβ lβ lβ : L), pβ β lβ β§ pβ β lβ β§ | |
pβ β lβ β§ pβ β lβ β§ pβ β lβ β§ pβ β lβ β§ pβ β lβ β§ pβ β lβ) | |
namespace projective_plane | |
@[priority 100] -- see Note [lower instance priority] | |
instance has_points [h : projective_plane P L] : has_points P L := { .. h } | |
@[priority 100] -- see Note [lower instance priority] | |
instance has_lines [h : projective_plane P L] : has_lines P L := { .. h } | |
instance [projective_plane P L] : projective_plane (dual L) (dual P) := | |
{ mk_line := @mk_point P L _ _, | |
mk_line_ax := Ξ» _ _, mk_point_ax, | |
mk_point := @mk_line P L _ _, | |
mk_point_ax := Ξ» _ _, mk_line_ax, | |
exists_config := by | |
{ obtain β¨pβ, pβ, pβ, lβ, lβ, lβ, hββ, hββ, hββ, hββ, hββ, hββ, hββ, hβββ© := | |
@exists_config P L _ _, | |
exact β¨lβ, lβ, lβ, pβ, pβ, pβ, hββ, hββ, hββ, hββ, hββ, hββ, hββ, hβββ© }, | |
.. dual.nondegenerate P L } | |
/-- The order of a projective plane is one less than the number of lines through an arbitrary point. | |
Equivalently, it is one less than the number of points on an arbitrary line. -/ | |
noncomputable def order [projective_plane P L] : β := | |
line_count L (classical.some (@exists_config P L _ _)) - 1 | |
variables [fintype P] [fintype L] | |
lemma card_points_eq_card_lines [projective_plane P L] : fintype.card P = fintype.card L := | |
le_antisymm (has_lines.card_le P L) (has_points.card_le P L) | |
variables {P} (L) | |
lemma line_count_eq_line_count [projective_plane P L] (p q : P) : | |
line_count L p = line_count L q := | |
begin | |
obtain β¨pβ, pβ, pβ, lβ, lβ, lβ, hββ, hββ, hββ, hββ, hββ, hββ, hββ, hβββ© := exists_config, | |
have h := card_points_eq_card_lines P L, | |
let n := line_count L pβ, | |
have hpβ : line_count L pβ = n := rfl, | |
have hlβ : point_count P lβ = n := (has_lines.line_count_eq_point_count h hββ).symm.trans hpβ, | |
have hpβ : line_count L pβ = n := (has_lines.line_count_eq_point_count h hββ).trans hlβ, | |
have hlβ : point_count P lβ = n := (has_lines.line_count_eq_point_count h hββ).symm.trans hpβ, | |
have hpβ : line_count L pβ = n := (has_lines.line_count_eq_point_count h hββ).trans hlβ, | |
have hlβ : point_count P lβ = n := (has_lines.line_count_eq_point_count h hββ).symm.trans hpβ, | |
suffices : β p : P, line_count L p = n, { exact (this p).trans (this q).symm }, | |
refine Ξ» p, or_not.elim (Ξ» hβ, _) (Ξ» hβ, (has_lines.line_count_eq_point_count h hβ).trans hlβ), | |
refine or_not.elim (Ξ» hβ, _) (Ξ» hβ, (has_lines.line_count_eq_point_count h hβ).trans hlβ), | |
rwa (eq_or_eq hβ hββ hβ hββ).resolve_right (Ξ» h, hββ ((congr_arg (has_mem.mem pβ) h).mp hββ)), | |
end | |
variables (P) {L} | |
lemma point_count_eq_point_count [projective_plane P L] (l m : L) : | |
point_count P l = point_count P m := | |
line_count_eq_line_count (dual P) l m | |
variables {P L} | |
lemma line_count_eq_point_count [projective_plane P L] (p : P) (l : L) : | |
line_count L p = point_count P l := | |
exists.elim (exists_point l) (Ξ» q hq, (line_count_eq_line_count L p q).trans | |
(has_lines.line_count_eq_point_count (card_points_eq_card_lines P L) hq)) | |
variables (P L) | |
lemma dual.order [projective_plane P L] : order (dual L) (dual P) = order P L := | |
congr_arg (Ξ» n, n - 1) (line_count_eq_point_count _ _) | |
variables {P} (L) | |
lemma line_count_eq [projective_plane P L] (p : P) : line_count L p = order P L + 1 := | |
begin | |
classical, | |
obtain β¨q, -, -, l, -, -, -, -, h, -β© := classical.some_spec (@exists_config P L _ _), | |
rw [order, line_count_eq_line_count L p q, line_count_eq_line_count L (classical.some _) q, | |
line_count, nat.card_eq_fintype_card, nat.sub_add_cancel], | |
exact fintype.card_pos_iff.mpr β¨β¨l, hβ©β©, | |
end | |
variables (P) {L} | |
lemma point_count_eq [projective_plane P L] (l : L) : point_count P l = order P L + 1 := | |
(line_count_eq (dual P) l).trans (congr_arg (Ξ» n, n + 1) (dual.order P L)) | |
variables (P L) | |
lemma one_lt_order [projective_plane P L] : 1 < order P L := | |
begin | |
obtain β¨pβ, pβ, pβ, lβ, lβ, lβ, -, -, hββ, hββ, hββ, hββ, hββ, hβββ© := @exists_config P L _ _, | |
classical, | |
rw [βadd_lt_add_iff_right, βpoint_count_eq, point_count, nat.card_eq_fintype_card], | |
simp_rw [fintype.two_lt_card_iff, ne, subtype.ext_iff], | |
have h := mk_point_ax (Ξ» h, hββ ((congr_arg _ h).mpr hββ)), | |
exact β¨β¨mk_point _, h.2β©, β¨pβ, hβββ©, β¨pβ, hβββ©, | |
ne_of_mem_of_not_mem h.1 hββ, ne_of_mem_of_not_mem h.1 hββ, ne_of_mem_of_not_mem hββ hβββ©, | |
end | |
variables {P} (L) | |
lemma two_lt_line_count [projective_plane P L] (p : P) : 2 < line_count L p := | |
by simpa only [line_count_eq L p, nat.succ_lt_succ_iff] using one_lt_order P L | |
variables (P) {L} | |
lemma two_lt_point_count [projective_plane P L] (l : L) : 2 < point_count P l := | |
by simpa only [point_count_eq P l, nat.succ_lt_succ_iff] using one_lt_order P L | |
variables (P) (L) | |
lemma card_points [projective_plane P L] : fintype.card P = order P L ^ 2 + order P L + 1 := | |
begin | |
obtain β¨p, -β© := @exists_config P L _ _, | |
let Ο : {q // q β p} β Ξ£ (l : {l : L // p β l}), {q // q β l.1 β§ q β p} := | |
{ to_fun := Ξ» q, β¨β¨mk_line q.2, (mk_line_ax q.2).2β©, q, (mk_line_ax q.2).1, q.2β©, | |
inv_fun := Ξ» lq, β¨lq.2, lq.2.2.2β©, | |
left_inv := Ξ» q, subtype.ext rfl, | |
right_inv := Ξ» lq, sigma.subtype_ext (subtype.ext ((eq_or_eq (mk_line_ax lq.2.2.2).1 | |
(mk_line_ax lq.2.2.2).2 lq.2.2.1 lq.1.2).resolve_left lq.2.2.2)) rfl }, | |
classical, | |
have h1 : fintype.card {q // q β p} + 1 = fintype.card P, | |
{ apply (eq_tsub_iff_add_eq_of_le (nat.succ_le_of_lt (fintype.card_pos_iff.mpr β¨pβ©))).mp, | |
convert (fintype.card_subtype_compl _).trans (congr_arg _ (fintype.card_subtype_eq p)) }, | |
have h2 : β l : {l : L // p β l}, fintype.card {q // q β l.1 β§ q β p} = order P L, | |
{ intro l, | |
rw [βfintype.card_congr (equiv.subtype_subtype_equiv_subtype_inter _ _), | |
fintype.card_subtype_compl (Ξ» (x : subtype (β l.val)), x.val = p), βnat.card_eq_fintype_card], | |
refine tsub_eq_of_eq_add ((point_count_eq P l.1).trans _), | |
rw β fintype.card_subtype_eq (β¨p, l.2β© : {q : P // q β l.1}), | |
simp_rw subtype.ext_iff_val }, | |
simp_rw [βh1, fintype.card_congr Ο, fintype.card_sigma, h2, finset.sum_const, finset.card_univ], | |
rw [βnat.card_eq_fintype_card, βline_count, line_count_eq, smul_eq_mul, nat.succ_mul, sq], | |
end | |
lemma card_lines [projective_plane P L] : fintype.card L = order P L ^ 2 + order P L + 1 := | |
(card_points (dual L) (dual P)).trans (congr_arg (Ξ» n, n ^ 2 + n + 1) (dual.order P L)) | |
end projective_plane | |
end configuration | |