Skip to content

blin/proof-checking-euclid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proof Checking Euclid

This repository is an attempt to understand

Beeson, Michael, et al. ‘Proof-Checking Euclid’. Annals of Mathematics and Artificial Intelligence, vol. 85, no. 2–4, Apr. 2019, pp. 213–57. DOI.org (Crossref), https://doi.org/10.1007/s10472-018-9606-x.

and https://github.com/GeoCoq/GeoCoq specifically.

Most of the code here is a direct translation but auto tactic and the like are not used. The goal is to be able to follow how the proof unfolds.

Reading order

Each lemma has a tree of dependencies, and so the dependencies need to be introduced in a particular order.

  1. euclidean_axioms
  2. by_def_InCirc_center
  3. by_def_OnCirc
  4. by_def_OutCirc
  5. by_prop_Cong_symmetric
  6. by_prop_Cong_transitive
  7. by_prop_Cong_flip
  8. by_prop_eq_symmetric
  9. by_prop_neq_symmetric
  10. euclidean_defs
  11. lemma_localextension
  12. lemma_orderofpoints_ABC_ACD_BCD
  13. by_prop_BetS_notequal
  14. lemma_extensionunique
  15. lemma_orderofpoints_ABC_BCD_ACD
  16. lemma_orderofpoints_ABC_BCD_ABD
  17. lemma_partnotequalwhole
  18. proposition_01
  19. by_def_InCirc_within_radius
  20. by_def_nCol_from_Triangle
  21. by_prop_nCol_distinct
  22. by_prop_Cong_doublereverse
  23. lemma_differenceofparts
  24. proposition_02
  25. lemma_betweennesspreserved
  26. lemma_extension
  27. by_prop_Lt_congruence
  28. proposition_03
  29. by_def_Col_from_BetS_A_B_C
  30. by_def_Col_from_BetS_A_C_B
  31. by_def_Col_from_BetS_B_A_C
  32. by_def_Col_from_eq_A_B
  33. by_def_Col_from_eq_A_C
  34. by_def_Col_from_eq_B_C
  35. by_def_Col_from_n_nCol
  36. by_def_nCol_from_n_Col
  37. by_def_n_Col_from_nCol
  38. lemma_orderofpoints_ABD_BCD_ACD
  39. lemma_orderofpoints_ABC_ACD_ABD
  40. lemma_outerconnectivity
  41. by_prop_Col_ABC_ABD_BCD
  42. by_prop_Col_ABC_BAC
  43. by_prop_Col_ABC_BCA
  44. by_prop_Col_order
  45. by_prop_OnRay_impliescollinear
  46. by_prop_OnRay_neq_A_B
  47. by_prop_OnRay_neq_A_C
  48. lemma_collinearitypreserved
  49. by_prop_CongA_NC
  50. by_def_Lt
  51. by_prop_OnRay_betweenness
  52. by_prop_OnRay_orderofpoints_any
  53. lemma_interior5
  54. lemma_layoffunique
  55. by_prop_nCol_order
  56. by_def_OnRay
  57. by_prop_OnRay_assert
  58. by_def_OnRay_from_neq_A_B
  59. lemma_s_conga_sss
  60. by_def_OnRay_from_BetS_A_B_E
  61. by_def_OnRay_from_BetS_A_E_B
  62. by_prop_OnRay_ABC_ACB
  63. lemma_s_onray_congruence_betweenness
  64. lemma_s_triangle_vertex_to_ray_congruent
  65. proposition_04
  66. by_def_CongA
  67. by_prop_CongA_ABCequalsCBA
  68. proposition_05
  69. by_def_Cut
  70. lemma_s_5_line
  71. lemma_s_Col_ABC_nCol_ABD_nCol_ACD
  72. lemma_s_Pasch_inner
  73. lemma_twolines
  74. proposition_10
  75. by_def_Perp_at
  76. by_def_RightTriangle
  77. proposition_12
  78. by_def_OppositeSide
  79. by_prop_Col_ABC_ABD_ABE_CDE
  80. lemma_oppositeside_betweenness_PABC_RPQ_QABC
  81. lemma_oppositeside_betweenness_PABC_RQP_QABC
  82. lemma_twolines2
  83. lemma_planeseparation
  84. by_def_Midpoint
  85. lemma_layoff
  86. by_prop_Lt_transitive
  87. lemma_midpointunique
  88. lemma_s_congruence_null_segment
  89. by_prop_RightTriangle_NC
  90. by_prop_RightTriangle_leg_change
  91. by_def_Supp
  92. by_prop_CongA_symmetric
  93. by_prop_CongA_distinct
  94. by_prop_OnRay_shared_initial_point
  95. by_prop_CongA_helper
  96. by_prop_CongA_transitive
  97. lemma_supplements_conga
  98. by_prop_RightTriangle_symmetric
  99. by_prop_RightTriangle_collinear
  100. by_def_SameSide
  101. by_prop_SameSide_symmetric
  102. by_prop_RightTriangle_reverse
  103. lemma_altitudebisectsbase
  104. lemma_droppedperpendicularunique
  105. lemma_fiveline
  106. proposition_07
  107. by_prop_Lt_trichotomous
  108. by_def_LtA
  109. by_prop_CongA_reflexive
  110. by_prop_LtA_respects_congruence_smaller
  111. by_prop_LtA_respects_congruence
  112. lemma_s_ncol_ABD_col_ABC_ncol_ACD
  113. lemma_crossbar
  114. by_prop_LtA_transitive
  115. lemma_sameside_onray
  116. lemma_angletrichotomy
  117. proposition_06a
  118. proposition_06
  119. proposition_08
  120. by_def_InAngle
  121. proposition_09
  122. proposition_11
  123. by_def_SumTwoRT
  124. by_prop_nCol_helper
  125. proposition_13
  126. by_prop_OppositeSide_symmetric
  127. proposition_14
  128. proposition_15
  129. by_def_LtA_from_InAngle
  130. proposition_16
  131. by_def_AngleSum
  132. by_def_Triangle
  133. proposition_17
  134. by_def_isosceles
  135. proposition_18
  136. proposition_19
  137. by_def_TogetherGreater
  138. proposition_20
  139. by_def_TT
  140. by_prop_Lt_congruence_smaller
  141. by_prop_TogetherGreater_flip
  142. by_prop_TogetherGreater_symmetric
  143. by_prop_TT_flip
  144. by_prop_TT_flip2
  145. by_prop_TT_order
  146. by_prop_TT_transitive
  147. by_prop_Lt_asymmetric
  148. by_prop_Lt_additive
  149. by_prop_Lt_between
  150. lemma_21helper
  151. proposition_21
  152. by_prop_Lt_notequal
  153. lemma_ondiameter
  154. lemma_subtractequals
  155. lemma_together
  156. proposition_22
  157. proposition_23
  158. by_prop_CongA_flip_left
  159. by_prop_CongA_flip_right
  160. by_prop_CongA_flip
  161. proposition_24
  162. proposition_15a
  163. lemma_pointreflectionisometry
  164. lemma_linereflectionisometry
  165. lemma_right_triangle_same_base_cong_side_cong_hypotenuse
  166. lemma_Euclid4
  167. lemma_sameside_onray_EFAC_BFG_EGAC
  168. lemma_oppositeside_onray_PABC_RQP_QABC
  169. by_prop_RightTriangle_CBA_n_ACB
  170. by_prop_SameSide_reflexive
  171. lemma_notperp
  172. proposition_11B
  173. proposition_23B
  174. proposition_23C
  175. lemma_angletrichotomy_n_CongA_ABC_DEF_n_LtA_DEF_ABC_LtA_ABC_DEF
  176. proposition_25
  177. proposition_26A
  178. by_def_Par
  179. lemma_s_col_ABC_col_ABD_ncol_ACD_eq_AB
  180. lemma_27helper_BetS_A_E_G
  181. lemma_27helper_OnRay_EA_G
  182. by_def_Meet
  183. lemma_collinearbetween
  184. proposition_27
  185. proposition_28A
  186. by_prop_Par_flip
  187. proposition_31
  188. by_prop_Supp_symmetric
  189. lemma_crossbar_LtA
  190. lemma_supplementinequality
  191. proposition_29
  192. by_def_Cross
  193. by_prop_Par_NC
  194. by_prop_Par_collinear
  195. by_prop_Par_symmetric
  196. by_def_TarskiPar
  197. by_prop_TarskiPar_collinear_ABcd_Ccd_ABCd
  198. by_prop_TarskiPar_collinear_ABcd_cCd_ABCd
  199. by_prop_TarskiPar_flip
  200. by_prop_TarskiPar_collinear
  201. by_prop_Par_to_TarskiPar
  202. lemma_crisscross
  203. lemma_30helper
  204. lemma_crossimpliesopposite
  205. proposition_30A
  206. proposition_30
  207. proposition_31short
  208. proposition_32
  209. proposition_27B
  210. proposition_29B
  211. proposition_33
  212. by_def_CongTriangles
  213. by_prop_SameSide_not_OppositeSide
  214. by_prop_SameSide_not_Cross
  215. lemma_diagonalsmeet
  216. proposition_34
  217. by_def_Parallelogram
  218. by_prop_CongTriangles_reflexive
  219. by_prop_EqAreaQuad_reflexive
  220. lemma_parallelPasch
  221. by_prop_EqAreaTri_reflexive
  222. by_prop_Parallelogram_flip
  223. by_prop_Parallelogram_rotate
  224. by_prop_Parallelogram_symmetric
  225. lemma_35helper
  226. lemma_diagonalsbisect
  227. lemma_trapezoiddiagonals
  228. proposition_29C
  229. proposition_35A
  230. proposition_35
  231. by_prop_Par_collinear2
  232. proposition_36
  233. lemma_samesidetransitive
  234. lemma_Playfairhelper
  235. lemma_Playfairhelper2
  236. lemma_Playfair
  237. lemma_triangletoparallelogram
  238. proposition_37
  239. proposition_38
  240. by_prop_SameSide_flip
  241. proposition_39A
  242. proposition_39
  243. proposition_40
  244. proposition_41
  245. lemma_samesidecollinear
  246. proposition_42
  247. proposition_43
  248. proposition_42B
  249. lemma_parallelbetween
  250. proposition_33B
  251. lemma_supplements_SumTwoRT
  252. proposition_28D
  253. proposition_43B
  254. proposition_44A
  255. proposition_44
  256. by_prop_SumTwoRT_congruence
  257. by_prop_SumTwoRT_symmetric
  258. proposition_45
  259. by_def_Square
  260. by_prop_RightTriangle_equaltoright
  261. proposition_46
  262. by_prop_OppositeSide_flip
  263. by_prop_Square_flip
  264. lemma_righttogether
  265. lemma_squareparallelogram
  266. by_prop_AngleSum_respects_congruence
  267. by_prop_RightTriangle_legsmallerhypotenuse
  268. by_prop_OnRay_ABC_BAC_BetS_ACB
  269. lemma_altitudeofrighttriangle
  270. lemma_erectedperpendicularunique
  271. proposition_28B
  272. lemma_twoperpsparallel
  273. proposition_47A
  274. proposition_47B
  275. proposition_47
  276. by_def_Rectangle
  277. by_prop_RightTriangle_supplement
  278. lemma_PGrectangle
  279. lemma_rectangleparallelogram
  280. lemma_paste5
  281. lemma_rectanglerotate
  282. lemma_squarerectangle
  283. lemma_squaresequal
  284. proposition_48A
  285. proposition_48

With all the above proved the following unrelated lemma can also be proved:

  1. lemma_road_to_reality_2_7

Differences from GeoCoq

  • cn_equalityreverse is renamed to cn_congruencereverse. I think the original name is due to how this common notion was applied in the .prf files: EEABBA cn:equalityreverse . I found this hard to follow given that the rest of the congruence common notions start with congruence.
  • lemma_3_6a and the like are renamed to lemma_orderofpoints_ABC_ACD_BCD and the like. Section "8 Book Zero and filling in book I" mentions "several important and often-used lemmas [that] are about the order of four points on a line, when two betweenness relations are known between them", which seems to match lemma_3_6a and the like. I found orderofpoints to be a more appropriate name for those lemmas.
  • axiom_innertransitivity is renamed to axiom_orderofpoints_ABD_BCD_ABC to match the renaming of lemma_3_6a into lemma_orderofpoints_ABC_ACD_BCD.
  • Most primitives and definitions are renamed to be more spelled out.
    • OS -> SameSide
      • OS presumably comes from "one side", but there are lemmas like lemma_samesidereflexive, whish suggest SameSide to be an appropriate name.
    • TS -> OppositeSide
      • TS presumably comes from "two sides", but there are lemmas like lemma_oppositesideflip, whish suggest OppositeSide to be an appropriate name.
    • Out -> OnRay
    • Per -> RightTriangle
      • I found definition of Square to be more natural with 4 RightTriangles than with 4 Pers.
    • RT -> SumTwoRT
    • SumA -> AngleSum
    • TG -> TogetherGreater
    • TP -> TarskiPar
    • CR -> Cross
    • PG -> Parallelogram
    • SQ -> Square
    • Cong_3 -> CongTriangles
    • ET -> EqAreaTri
      • Being explicit about the kind of equality used seems prudent, especially given how prominent congruence is.
    • EF -> EqAreaQuad
    • RE -> Rectangle
  • Lemmas that encode properties of objects that can be pithily expressed were renamed to start with by_prop_$OBJECT_ so that it is easier to find them and to ignore them in proof text. If there was no pithy way to express the property, or if the proof of the property turned out to be very complex, I've mostly left unchanged.
  • lemma_onray[12345] instead of having numeric suffixes have evocative if not descriptive suffixes, by_prop_OnRay_orderofpoints_any instead of lemma_ray1.
  • lemma_collinear[124] instead of having a numeric suffixes have evocative if not descriptive suffixes, by_prop_Col_ABC_BAC instead of lemma_collinear1.
  • You can find the full list of renames in sed_renames.txt.
  • Many lemmas are introduced to make it easier to use some of the definitions, these lemmas were named to start with by_def_$OBJECT_.
  • Many lemmas are introduced to make sense of what is going on. Newly introduced lemmas start with lemma_s , with s for supporting.
  • Long proofs by contradiction that assert the lemma's goal were re-structured as proofs "by cases", thus turning contrdict+exact into just exact.

Diagrams

How diagrams were generated

  1. Diagrams were built by hand in GeoGebra .
  2. Downloaded as SVG.
  3. Clipped with Inkscape .
  4. Cleaned up with format_geogebra_svg.sh .

GeoGebra is used as a way of enforcing straightedge-and-compass construction.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published