-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tarski_Continuity.thy
5754 lines (5426 loc) · 228 KB
/
Tarski_Continuity.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(* IsageoCoq2_R1
Tarski_Continuity.thy
TODO
[ ] Completeness: tout revoir : f entre 2 espaces différents
[ ] all def
[ ] all prop
[ ] move Require Export GeoCoq.Tarski_dev.Ch12_parallel.
[ ] move part circle with Tarski2D
Version 2.2.0 IsaGeoCoq2_R1, Port part of GeoCoq 3.4.0
Version 2.1.0 IsaGeoCoq2_R1, Port part of GeoCoq 3.4.0
Copyright (C) 2021-2023 Roland Coghetto roland.coghetto ( a t ) cafr-msa2p.be
License: LGPGL
History
Version 1.0.0: IsaGeoCoq
Port part of GeoCoq 3.4.0 (https://geocoq.github.io/GeoCoq/) in Isabelle/Hol (Isabelle2021)
Copyright (C) 2021 Roland Coghetto roland_coghetto (at) hotmail.com
License: LGPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
(*<*)
theory Tarski_Continuity
imports
HOL.Orderings
Tarski_Neutral
Tarski_Archimedes
Tarski_2D (*peut-être faire 2 fichiers ?*)
begin
(*>*)
context Tarski_neutral_dimensionless
begin
subsection "Circle"
subsubsection "Circle-Def"
(** P is on the circle of center A going through B *)
definition OnCircle ::
"[TPoint,TPoint,TPoint] \<Rightarrow> bool"
("_ OnCircle _ _ " [99,99,99] 50)
where
"P OnCircle A B \<equiv> Cong A P A B"
(** P is inside or on the circle of center A going through B *)
definition InCircle ::
"[TPoint,TPoint,TPoint] \<Rightarrow> bool"
("_ InCircle _ _ " [99,99,99] 50)
where
"P InCircle A B \<equiv> A P Le A B"
(** P is outside or on the circle of center A going through B *)
definition OutCircle ::
"[TPoint,TPoint,TPoint] \<Rightarrow> bool"
("_ OutCircle _ _ " [99,99,99] 50)
where
"P OutCircle A B \<equiv> A B Le A P"
(** P is strictly inside the circle of center A going through B *)
definition InCircleS ::
"[TPoint,TPoint,TPoint] \<Rightarrow> bool"
("_ InCircleS _ _ " [99,99,99] 50)
where
"P InCircleS A B \<equiv> A P Lt A B"
(** P is strictly outside the circle of center A going through B *)
definition OutCircleS ::
"[TPoint,TPoint,TPoint] \<Rightarrow> bool"
("_ OutCircleS _ _ " [99,99,99] 50)
where
"P OutCircleS A B \<equiv> A B Lt A P"
(** The line segment AB is a diameter of the circle of center O going through P *)
definition Diam ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("Diam _ _ _ _ " [99,99,99,99] 50)
where
"Diam A B PO P \<equiv> Bet A PO B \<and> A OnCircle PO P \<and> B OnCircle PO P"
definition EqC ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("EqC _ _ _ _ " [99,99,99,99] 50)
where
"EqC A B C D \<equiv>
\<forall> X. (X OnCircle A B \<longleftrightarrow> X OnCircle C D)"
(** The circles of center A passing through B and
of center C passing through D intersect
in two distinct points P and Q. *)
definition InterCCAt ::
"[TPoint,TPoint,TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("InterCCAt _ _ _ _ _ _ " [99,99,99,99,99,99] 50)
where
"InterCCAt A B C D P Q \<equiv>
\<not> EqC A B C D \<and>
P \<noteq> Q \<and> P OnCircle C D \<and> Q OnCircle C D \<and> P OnCircle A B \<and> Q OnCircle A B"
(** The circles of center A passing through B and
of center C passing through D
have two distinct intersections. *)
definition InterCC ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("InterCC _ _ _ _ " [99,99,99,99] 50)
where
"InterCC A B C D \<equiv> \<exists> P Q. InterCCAt A B C D P Q"
(** The circles of center A passing through B and
of center C passing through D
are tangent. *)
definition TangentCC ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("TangentCC _ _ _ _ " [99,99,99,99] 50)
where
"TangentCC A B C D \<equiv> \<exists>\<^sub>\<le>\<^sub>1 X. X OnCircle A B \<and> X OnCircle C D"
(** The line AB is tangent to the circle OP *)
definition Tangent ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("Tangent _ _ _ _ " [99,99,99,99] 50)
where
"Tangent A B PO P \<equiv> \<exists>\<^sub>\<le>\<^sub>1 X. Col A B X \<and> X OnCircle PO P"
definition TangentAt ::
"[TPoint,TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("TangentAt _ _ _ _ _ " [99,99,99,99,99] 50)
where
"TangentAt A B PO P T \<equiv>
Tangent A B PO P \<and> Col A B T \<and> T OnCircle PO P"
(** The points A, B, C and D belong to a same circle *)
definition Concyclic ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("Concyclic _ _ _ _ " [99,99,99,99] 50)
where
"Concyclic A B C D \<equiv> Coplanar A B C D \<and>
(\<exists> PO P. A OnCircle PO P \<and> B OnCircle PO P \<and>
C OnCircle PO P \<and> D OnCircle PO P)"
(** The points A, B, C and D are concyclic or lined up *)
definition ConcyclicGen ::
"[TPoint,TPoint,TPoint,TPoint] \<Rightarrow> bool"
("ConcyclicGen _ _ _ _ " [99,99,99,99] 50)
where
"ConcyclicGen A B C D \<equiv>
Concyclic A B C D \<or>
(Col A B C \<and> Col A B D \<and> Col A C D \<and> Col B C D)"
subsubsection "Circle Propositions"
lemma inc112:
shows "A InCircle A B"
by (meson InCircle_def l5_5_2 not_bet_distincts segment_construction_0)
lemma onc212:
shows "B OnCircle A B"
by (simp add: OnCircle_def cong_reflexivity)
lemma onc_sym:
assumes "P OnCircle A B"
shows "B OnCircle A P"
using Cong_cases OnCircle_def assms by auto
lemma ninc__outcs:
assumes "\<not> (X InCircle PO P)"
shows "X OutCircleS PO P"
using nle__lt InCircle_def OutCircleS_def assms by blast
lemma inc__outc_1:
assumes "P InCircle A B"
shows "B OutCircle A P"
using InCircle_def OutCircle_def assms by blast
lemma inc__outc_2:
assumes "B OutCircle A P"
shows "P InCircle A B"
using InCircle_def OutCircle_def assms by blast
lemma inc__outc:
shows "P InCircle A B \<longleftrightarrow> B OutCircle A P"
by (simp add: InCircle_def OutCircle_def)
lemma incs__outcs_1:
assumes "P InCircleS A B"
shows "B OutCircleS A P"
using InCircleS_def OutCircleS_def assms by blast
lemma incs__outcs_2:
assumes "B OutCircleS A P"
shows "P InCircleS A B"
using InCircleS_def OutCircleS_def assms by blast
lemma incs__outcs:
shows "P InCircleS A B \<longleftrightarrow> B OutCircleS A P"
using incs__outcs_1 incs__outcs_2 by blast
lemma onc__inc:
assumes "P OnCircle A B"
shows "P InCircle A B"
using InCircle_def OnCircle_def assms cong__le by blast
lemma onc__outc:
assumes "P OnCircle A B"
shows "P OutCircle A B"
by (simp add: assms inc__outc_1 onc__inc onc_sym)
lemma inc_outc__onc:
assumes "P InCircle A B" and
"P OutCircle A B"
shows "P OnCircle A B"
using InCircle_def OnCircle_def OutCircle_def assms(1) assms(2) le_anti_symmetry by blast
lemma incs__inc:
assumes "P InCircleS A B"
shows "P InCircle A B"
using InCircle_def InCircleS_def Lt_def assms by blast
lemma outcs__outc:
assumes "P OutCircleS A B"
shows "P OutCircle A B"
using assms inc__outc incs__inc incs__outcs by blast
lemma incs__noutc_1:
assumes "P InCircleS A B"
shows "\<not> P OutCircle A B"
using InCircleS_def OutCircle_def assms le__nlt by blast
lemma incs__noutc_2:
assumes "\<not> P OutCircle A B"
shows "P InCircleS A B"
using assms inc__outc_1 incs__outcs_2 ninc__outcs by blast
lemma incs__noutc:
shows "P InCircleS A B \<longleftrightarrow> \<not> P OutCircle A B"
using incs__noutc_1 incs__noutc_2 by blast
lemma outcs__ninc_1:
assumes "P OutCircleS A B"
shows "\<not> P InCircle A B"
by (simp add: assms inc__outc incs__noutc_1 incs__outcs_2)
lemma outcs__ninc_2:
assumes "\<not> P InCircle A B"
shows "P OutCircleS A B"
by (simp add: assms ninc__outcs)
lemma outcs__ninc:
shows "P OutCircleS A B \<longleftrightarrow> \<not> P InCircle A B"
using inc__outc_1 incs__noutc_1 incs__outcs_2 ninc__outcs by blast
lemma inc__noutcs_1:
assumes "P InCircle A B"
shows "\<not> P OutCircleS A B"
using assms outcs__ninc_1 by blast
lemma inc__noutcs_2:
assumes "\<not> P OutCircleS A B"
shows "P InCircle A B"
using assms outcs__ninc_2 by blast
lemma inc__noutcs:
"P InCircle A B \<longleftrightarrow> \<not> P OutCircleS A B"
by (simp add: outcs__ninc)
lemma outc__nincs_1:
assumes "P OutCircle A B"
shows "\<not> P InCircleS A B"
using assms incs__noutc_1 by blast
lemma outc__nincs_2:
assumes "\<not> P InCircleS A B"
shows "P OutCircle A B"
using assms incs__noutc by blast
lemma outc__nincs:
shows "P OutCircle A B \<longleftrightarrow> \<not> P InCircleS A B"
using incs__noutc by force
lemma inc_eq:
assumes "P InCircle A A"
shows "A = P"
by (metis OnCircle_def assms bet_cong_eq between_trivial2 inc112 inc__outc inc_outc__onc)
lemma outc_eq:
assumes "A OutCircle A B"
shows "A = B"
by (meson OnCircle_def assms bet_cong_eq between_trivial2 inc112 inc_outc__onc)
lemma onc2__cong:
assumes "A OnCircle PO P" and
"B OnCircle PO P"
shows "Cong PO A PO B"
by (meson OnCircle_def assms(1) assms(2) cong_transitivity onc_sym)
(** If a point is strictly inside a segment of a disk, it is strictly inside the circle. *)
lemma bet_inc2__incs:
assumes "X \<noteq> U" and
"X \<noteq> V" and
"Bet U X V" and
"U InCircle PO P" and
"V InCircle PO P"
shows "X InCircleS PO P"
proof -
{
assume "PO U Le PO V"
hence "PO X Lt PO V"
using Le_cases assms(1) assms(2) assms(3) bet_le__lt lt_comm by blast
hence "X InCircleS PO P"
using InCircleS_def InCircle_def assms(5) le3456_lt__lt by blast
}
moreover
{
assume "PO V Le PO U"
hence "PO X Lt PO U"
using assms(1) assms(2) assms(3) bet_le__lt between_symmetry le_comm lt_comm by blast
hence "X InCircleS PO P"
by (meson InCircle_def OutCircle_def assms(4) le__nlt le_transitivity outc__nincs_2)
}
ultimately show ?thesis
using local.le_cases by blast
qed
lemma bet_incs2__incs:
assumes "Bet U X V" and
"U InCircleS PO P" and
"V InCircleS PO P"
shows "X InCircleS PO P"
by (metis assms(1) assms(2) assms(3) bet_inc2__incs incs__inc)
(** If A and B are two points inside the circle, then all points on the segment AB are also
in the circle, i.e. a circle is a convex figure.
*)
lemma bet_inc2__inc:
assumes "U InCircle A B" and
"V InCircle A B" and
"Bet U P V"
shows "P InCircle A B"
by (metis assms(1) assms(2) assms(3) bet_inc2__incs incs__inc)
(** Given two points U and V on a circle, the points of the line UV which are inside
the circle are between U and V. *)
lemma col_inc_onc2__bet:
assumes "U \<noteq> V" and
"U OnCircle A B" and
"V OnCircle A B" and
"Col U V P" and
"P InCircle A B"
shows "Bet U P V"
proof (cases "P = U")
case True
thus ?thesis
by (simp add: between_trivial2)
next
case False
hence "P \<noteq> U"
by simp
show ?thesis
proof (cases "P = V")
case True
thus ?thesis
using between_trivial by force
next
case False
hence "P \<noteq> V"
by simp
have "Cong A U A V"
using assms(2) assms(3) onc2__cong by auto
have "U Out P V"
by (metis Col_cases \<open>P \<noteq> U\<close> assms(1) assms(2) assms(3) assms(4)
assms(5) bet_inc2__incs incs__noutc_1 onc__inc onc__outc or_bet_out)
moreover have "V Out U P"
by (metis False assms(2) assms(3) assms(4) assms(5) bet_inc2__incs
calculation l6_3_1 onc__inc onc__outc or_bet_out outc__nincs)
ultimately show ?thesis
using out2__bet by blast
qed
qed
(** Given two points U and V on a circle, all points of line UV which are outside
the segment UV are outside the circle. *)
lemma onc2_out__outcs:
assumes "U \<noteq> V" and
"U OnCircle A B" and
"V OnCircle A B" and
"P Out U V"
shows "P OutCircleS A B"
by (meson Col_cases assms(1) assms(2) assms(3) assms(4)
col_inc_onc2__bet not_bet_and_out out_col outcs__ninc_2)
(** Given two points U and V inside a circle, all points of line UV which are outside
the circle are outside the segment UV. *)
lemma col_inc2_outcs__out:
assumes "U InCircle A B" and
"V InCircle A B" and
"Col U V P" and
"P OutCircleS A B"
shows "P Out U V"
by (meson Col_cases assms(1) assms(2) assms(3) assms(4)
bet_inc2__inc or_bet_out outcs__ninc_1)
(** If the center of a circle belongs to a chord, then it is the midpoint of the chord. *)
lemma col_onc2__mid:
assumes "U \<noteq> V" and
"U OnCircle A B" and
"V OnCircle A B" and
"Col U V A"
shows "A Midpoint U V"
using Col_cases assms(1) assms(2) assms(3) assms(4) l7_20 onc2__cong by blast
(** Given a point U on a circle and a point P inside the circle, there is a point V such as
UV is a chord of the circle going through P. *)
lemma chord_completion:
assumes "U OnCircle A B" and
"P InCircle A B"
shows "\<exists> V. V OnCircle A B \<and> Bet U P V"
proof (cases "U = A")
case True
then show ?thesis
using OnCircle_def assms(1) assms(2) between_trivial2
cong_reverse_identity inc_eq by blast
next
case False
hence "U \<noteq> A"
by simp
have "\<exists> A'. U \<noteq> A' \<and> Col U P A' \<and> Per A A' U"
proof (cases "Col U P A")
case True
thus ?thesis
using False l8_20_1_R1 by blast
next
case False
hence "\<not> Col U P A"
by simp
obtain A' where "Col U P A'" and "U P Perp A A'"
using False l8_18_existence by blast
{
assume "U = A'"
have "U \<noteq> P"
using False not_col_distincts by auto
have "Per P U A \<or> Obtuse P U A"
using Perp_perm \<open>U = A'\<close> \<open>U P Perp A A'\<close> perp_per_2 by blast
hence "U A Lt P A"
using \<open>U \<noteq> A\<close> \<open>U \<noteq> P\<close> l11_46 by auto
hence False
by (meson Cong_cases InCircleS_def OnCircle_def assms(1) assms(2)
cong2_lt__lt cong_reflexivity inc__outc incs__noutc)
}
hence "U \<noteq> A'"
by auto
moreover have "Per A A' U"
using \<open>Col U P A'\<close> \<open>U P Perp A A'\<close> col_trivial_3 l8_16_1 by blast
ultimately show ?thesis
using \<open>Col U P A'\<close> by blast
qed
then obtain A' where "U \<noteq> A'" and "Col U P A'" and "Per A A' U"
by auto
obtain V where "A' Midpoint U V"
using symmetric_point_construction by auto
hence "Cong A U A V"
using \<open>Per A A' U\<close> per_double_cong by auto
hence "V OnCircle A B"
using OnCircle_def assms(1) cong_inner_transitivity by blast
have "Col U V P"
by (meson Midpoint_def \<open>A' Midpoint U V\<close> \<open>Col U P A'\<close> \<open>U \<noteq> A'\<close>
bet_col col_permutation_5 col_transitivity_1)
thus ?thesis using col_inc_onc2__bet
by (metis \<open>A' Midpoint U V\<close> \<open>U \<noteq> A'\<close> \<open>V OnCircle A B\<close>
assms(1) assms(2) midpoint_distinct_2)
qed
(** Given a circle, there is a point strictly outside the circle. *)
lemma outcs_exists:
shows "\<exists> Q. Q OutCircleS PO P"
by (meson bet_inc2__incs inc__noutcs_2 incs__outcs point_construction_different)
(** Given a circle of center O and a ray OX, there is a point on the ray
which is also strictly outside the circle. *)
lemma outcs_exists1:
assumes "X \<noteq> PO"
shows "\<exists> Q. PO Out X Q \<and> Q OutCircleS PO P"
proof -
obtain Q where "Bet PO X Q" and "Cong X Q PO P"
using segment_construction by blast
have "PO Out X Q"
using \<open>Bet PO X Q\<close> assms bet_out by auto
moreover have "\<not> Cong PO P PO Q"
using \<open>Bet PO X Q\<close> \<open>Cong X Q PO P\<close> assms bet_cong_eq between_trivial
cong_transitivity by blast
hence "Q OutCircleS PO P"
using OutCircleS_def by (meson Bet_cases \<open>Bet PO X Q\<close> \<open>Cong X Q PO P\<close>
assms bet__lt1213 cong2_lt__lt cong_pseudo_reflexivity not_cong_1243)
ultimately show ?thesis
by auto
qed
(** Given a circle there is a point which is strictly inside. *)
lemma incs_exists:
assumes "PO \<noteq> P"
shows "\<exists> Q. Q InCircleS PO P"
using assms incs__noutc outc_eq by blast
(** Given a circle of center O and a ray OX, there is a point on the ray
which is also strictly inside the circle. *)
lemma incs_exists1:
assumes "X \<noteq> PO" and
"P \<noteq> PO"
shows "\<exists> Q. PO Out X Q \<and> Q InCircleS PO P"
proof -
obtain M where "M Midpoint PO P"
using midpoint_existence by blast
obtain Q where "PO Out X Q" and "Cong PO Q PO M"
by (metis Midpoint_def \<open>M Midpoint PO P\<close> assms(1) assms(2) between_cong_2
between_trivial2 point_construction_different segment_construction_3)
have "PO M Lt PO P"
using \<open>M Midpoint PO P\<close> assms(2) mid__lt by presburger
hence "Q InCircleS PO P"
using InCircleS_def \<open>Cong PO Q PO M\<close> cong2_lt__lt cong_reflexivity not_cong_3412 by blast
thus ?thesis
using \<open>PO Out X Q\<close> by blast
qed
(** Given a circle of center O and a ray OX, there is a point on the ray
which is also on the circle. *)
lemma onc_exists:
assumes "X \<noteq> PO" and
"PO \<noteq> P"
shows "\<exists> Q. Q OnCircle PO P \<and> PO Out X Q"
by (meson OnCircle_def assms(1) assms(2) l6_11_existence l6_6)
(** Given a circle of center O and a line OX, O is between two points of the line
which are also on the circle. *)
lemma diam_points:
shows "\<exists> Q1 Q2. Bet Q1 PO Q2 \<and> Col Q1 Q2 X \<and> Q1 OnCircle PO P \<and> Q2 OnCircle PO P"
proof (cases "P = PO")
case True
thus ?thesis
using between_trivial col_trivial_1 onc212 by blast
next
case False
hence "P \<noteq> PO"
by simp
show ?thesis
proof (cases "X = PO")
case True
thus ?thesis
by (meson Col_def OnCircle_def between_symmetry segment_construction)
next
case False
hence "X \<noteq> PO"
by simp
obtain Q1 where "Q1 OnCircle PO P" and "PO Out X Q1"
using False \<open>P \<noteq> PO\<close> onc_exists by metis
obtain Q2 where "Bet Q1 PO Q2" and "Cong PO Q2 PO Q1"
using segment_construction by blast
have "Col Q1 Q2 X"
by (metis Col_def Out_cases \<open>Bet Q1 PO Q2\<close> \<open>PO Out X Q1\<close>
between_trivial2 col_transitivity_2 not_bet_and_out out_col)
moreover have "Q2 OnCircle PO P"
by (meson OnCircle_def \<open>Cong PO Q2 PO Q1\<close> \<open>Q1 OnCircle PO P\<close> onc2__cong onc_sym)
ultimately show ?thesis
using \<open>Bet Q1 PO Q2\<close> \<open>Q1 OnCircle PO P\<close> by blast
qed
qed
(** The symmetric of a point on a circle relative to the center is also on the circle. *)
lemma symmetric_oncircle:
assumes "PO Midpoint X Y" and
"X OnCircle PO P"
shows "Y OnCircle PO P"
by (meson OnCircle_def assms(1) assms(2) midpoint_cong not_cong_4312 onc2__cong onc_sym)
(** The middle of a chord together with the center of the circle and one end of the chord
form a right angle *)
lemma mid_onc2__per:
assumes "U OnCircle PO P" and
"V OnCircle PO P" and
"X Midpoint U V"
shows "Per PO X U"
using Per_def assms(1) assms(2) assms(3) onc2__cong by blast
(** Euclid Book III Prop 3 (two lemmas).
If a straight line passing through the center of a circle
bisects a straight line not passing through the center,
then it also cuts it at right angles; and if it cuts it at right angles, then it also bisects it.
*)
(** The line from the center of a circle to the midpoint of a chord is perpendicular
to the chord. *)
lemma mid_onc2__perp:
assumes "PO \<noteq> X" and
"A \<noteq> B" and
"A OnCircle PO P" and
"B OnCircle PO P" and
"X Midpoint A B"
shows "PO X Perp A B"
proof -
have "Per PO X A"
using assms(3) assms(4) assms(5) mid_onc2__per by blast
thus ?thesis
by (metis Perp_cases assms(1) assms(2) assms(5) col_per_perp
is_midpoint_id midpoint_col)
qed
(** If a line passing through the center of a circle is perpendicular to a chord,
then they intersect at the middle of the chord *)
lemma col_onc2_perp__mid:
assumes "PO \<noteq> X" and
"A \<noteq> B" and
"Col A B X" and
"A OnCircle PO P" and
"B OnCircle PO P" and
"PO X Perp A B"
shows "X Midpoint A B"
proof -
obtain M where "M Midpoint A B"
using midpoint_existence by blast
have "\<not> Col A B PO"
using assms(1) assms(3) assms(6) l8_14_1 perp_col2_bis by blast
hence "PO \<noteq> M"
using \<open>M Midpoint A B\<close> midpoint_col not_col_permutation_2 by blast
hence "A B Perp PO M"
using Perp_cases \<open>M Midpoint A B\<close>assms(2) assms(4) assms(5) mid_onc2__perp by blast
hence "X = M"
by (meson NCol_cases Perp_perm \<open>M Midpoint A B\<close> assms(3) assms(6)
l8_18_uniqueness midpoint_col)
thus ?thesis
by (simp add: \<open>M Midpoint A B\<close>)
qed
(** If two circles intersect at a point which is not on the line joining the center,
then they intersect on any half-plane delimited by that line. *)
lemma circle_circle_os:
assumes "I OnCircle A B" and
"I OnCircle C D" and
"\<not> Col A C I" and
"\<not> Col A C P"
shows "\<exists> Z. Z OnCircle A B \<and> Z OnCircle C D \<and> A C OS P Z"
proof -
obtain X where "Col A C X" and "A C Perp I X"
using assms(3) l8_18_existence by fastforce
obtain Z0 where "A C Perp Z0 X" and "A C OS P Z0"
using \<open>Col A C X\<close> assms(4) l10_15 by blast
obtain Z where "X Out Z Z0" and "Cong X Z X I"
by (metis Out_def \<open>A C OS P Z0\<close> \<open>Col A C X\<close> assms(3) col_trivial_2
l6_11_existence l9_19)
have "A C Perp X Z"
by (metis \<open>A C Perp Z0 X\<close> \<open>X Out Z Z0\<close> between_trivial
l6_6 not_bet_and_out out_col perp_col1 perp_right_comm)
have "Cong A Z A I"
proof (cases "A = X")
case True
thus ?thesis
by (simp add: \<open>Cong X Z X I\<close>)
next
case False
hence "A \<noteq> X"
by simp
show ?thesis
proof (rule l10_12 [where ?B = "X" and ?B'="X"], insert \<open>Cong X Z X I\<close>)
show "Per A X Z"
by (meson False \<open>A C Perp X Z\<close> \<open>Col A C X\<close> l8_16_1 not_col_distincts perp_col0)
show "Per A X I"
by (metis NCol_cases \<open>A C Perp I X\<close> \<open>Col A C X\<close> col_trivial_2 l8_16_1 l8_2)
show "Cong A X A X"
using cong_reflexivity by auto
qed
qed
hence "Z OnCircle A B"
using OnCircle_def assms(1) cong_transitivity by blast
moreover
have "Cong C Z C I"
proof -
show ?thesis
proof (rule l10_12 [where ?B = "X" and ?B'="X"], insert \<open>Cong X Z X I\<close>)
show "Per C X Z"
by (metis NCol_perm \<open>A C Perp X Z\<close> \<open>Col A C X\<close> col_trivial_3 l8_16_1 l8_2 perp_comm)
show "Per C X I"
using \<open>A C Perp I X\<close> \<open>Col A C X\<close> col_trivial_2 l8_16_1 l8_2 by blast
show "Cong C X C X"
by (simp add: cong_reflexivity)
qed
qed
hence "Z OnCircle C D"
by (meson OnCircle_def assms(2) onc2__cong onc_sym)
moreover
have "A C OS Z0 Z"
by (metis Out_def \<open>A C OS P Z0\<close> \<open>Col A C X\<close> \<open>X Out Z Z0\<close> col124__nos l9_19_R2)
hence "A C OS P Z"
using \<open>A C OS P Z0\<close> one_side_transitivity by blast
ultimately show ?thesis
by blast
qed
(** If two circles intersect, then they intersect on any plane containing the centers *)
lemma circle_circle_cop:
assumes "I OnCircle A B" and
"I OnCircle C D"
shows "\<exists> Z. Z OnCircle A B \<and> Z OnCircle C D \<and> Coplanar A C P Z"
proof (cases "Col A C P")
case True
then show ?thesis
using assms(1) assms(2) ncop__ncol by blast
next
case False
hence "\<not> Col A C P"
by simp
show ?thesis
proof (cases "Col A C I")
case True
then show ?thesis
using assms(1) assms(2) ncop__ncols by blast
next
case False
obtain Z where "Z OnCircle A B" and "Z OnCircle C D" and "A C OS P Z"
using False \<open>\<not> Col A C P\<close> assms(1) assms(2) circle_circle_os by force
moreover have "Coplanar A C P Z"
by (simp add: calculation(3) os__coplanar)
ultimately show ?thesis
by blast
qed
qed
(** A circle does not cut a line at more than two points. *)
lemma line_circle_two_points:
assumes "U \<noteq> V" and
"Col U V W" and
"U OnCircle PO P" and
"V OnCircle PO P" and
"W OnCircle PO P"
shows "W = U \<or> W = V"
by (metis assms(1) assms(2) assms(3) assms(4) assms(5)
cong2__ncol not_cong_4321 onc2__cong)
(** The midpoint of a chord is strictly inside the circle. *)
lemma onc2_mid__incs:
assumes "U \<noteq> V" and
"U OnCircle PO P" and
"V OnCircle PO P" and
"M Midpoint U V"
shows "M InCircleS PO P"
by (metis Midpoint_def assms(1) assms(2) assms(3) assms(4)
bet_inc2__incs midpoint_not_midpoint midpoint_out onc__inc out_diff1)
(** A point is either strictly inside, on or strictly outside a circle. *)
lemma circle_cases:
shows "X OnCircle PO P \<or> X InCircleS PO P \<or> X OutCircleS PO P"
using inc_outc__onc outc__nincs_2 outcs__ninc_2 by blast
(** If a point is inside a circle, then it lies on a radius. *)
lemma inc__radius:
assumes "X InCircle PO P"
shows "\<exists> Y. Y OnCircle PO P \<and> Bet PO X Y"
by (meson Bet_cases OnCircle_def assms between_exchange3
chord_completion segment_construction)
lemma inc_onc2_out__eq:
assumes "A InCircle PO P" and
"B OnCircle PO P" and
"C OnCircle PO P" and
"A Out B C"
shows "B = C"
using assms(1) assms(2) assms(3) assms(4) inc__noutcs_1
onc2_out__outcs by blast
lemma onc_not_center:
assumes "PO \<noteq> P" and
"A OnCircle PO P"
shows "A \<noteq> PO"
using OnCircle_def assms(1) assms(2) cong_reverse_identity by blast
lemma onc2_per__mid:
assumes "U \<noteq> V" and
"M \<noteq> U" and
"U OnCircle PO P" and
"V OnCircle PO P" and
"Col M U V" and
"Per PO M U"
shows "M Midpoint U V"
proof -
obtain M' where "M' Midpoint U V"
using midpoint_existence by auto
have "Per PO M' U"
using \<open>M' Midpoint U V\<close> assms(3) assms(4) mid_onc2__per by blast
have "M = M' \<or> \<not> Col M' U V"
by (metis \<open>M' Midpoint U V\<close> \<open>Per PO M' U\<close> assms(1) assms(2)
assms(5) assms(6) col_per2_cases midpoint_distinct_3)
hence "M = M'"
using \<open>M' Midpoint U V\<close> midpoint_col by auto
thus ?thesis
by (simp add: \<open>M' Midpoint U V\<close>)
qed
(** Euclid Book III Prop 14
Equal straight lines in a circle are equally distant from the center,
and those which are equally distant from the center equal one another.
*)
lemma cong_chord_cong_center:
assumes "A OnCircle PO P" and
"B OnCircle PO P" and
"C OnCircle PO P" and
"D OnCircle PO P" and
"M Midpoint A B" and
"N Midpoint C D" and
"Cong A B C D"
shows "Cong PO N PO M"
proof -
have "Cong M B N D"
by (meson assms(5) assms(6) assms(7) cong_commutativity cong_cong_half_1 l7_2)
have "A M B PO IFSC C N D PO"
using IFSC_def \<open>Cong M B N D\<close> assms(1) assms(2) assms(3) assms(4)
assms(5) assms(6) assms(7) midpoint_bet not_cong_4321 onc2__cong by blast
hence "Cong M PO N PO"
by (simp add: l4_2)
thus ?thesis
using not_cong_4321 by blast
qed
(** variant *)
lemma cong_chord_cong_center1:
assumes "A \<noteq> B" and
"C \<noteq> D" and
"M \<noteq> A" and
"N \<noteq> C"
"A OnCircle PO P" and
"B OnCircle PO P" and
"C OnCircle PO P" and
"D OnCircle PO P" and
"Col M A B" and
"Col N C D" and
"Per PO M A" and
"Per PO N C" and
"Cong A B C D"
shows "Cong PO N PO M"
using assms(1) assms(10) assms(11) assms(12) assms(13) assms(2) assms(3)
assms(4) assms(5) assms(6) assms(7) assms(8) assms(9)
cong_chord_cong_center onc2_per__mid by presburger
(** Prop 7 **)
lemma onc_sym__onc:
assumes "Bet PO A B" and
"A OnCircle PO P" and
"B OnCircle PO P" and
"X OnCircle PO P" and
"X Y ReflectL A B"
shows "Y OnCircle PO P"
using assms(1) assms(2) assms(3) assms(4) assms(5)
between_cong image_spec__eq onc2__cong by blast
lemma mid_onc__diam:
assumes "A OnCircle PO P" and
"PO Midpoint A B"
shows "Diam A B PO P"
using Diam_def assms(1) assms(2) midpoint_bet symmetric_oncircle by blast
lemma chord_le_diam:
assumes "Diam A B PO P" and
"U OnCircle PO P" and
"V OnCircle PO P"
shows "U V Le A B"
proof (rule triangle_inequality_2 [where ?B="PO" and ?B'="PO"])
show "Bet A PO B"
using Diam_def assms(1) by auto
show "Cong U PO A PO"
using Diam_def assms(1) assms(2) not_cong_4321 onc2__cong by blast
show "Cong PO V PO B"
using Diam_def assms(1) assms(3) onc2__cong by auto
qed
lemma chord_lt_diam:
assumes "\<not> Col PO U V" and
"Diam A B PO P" and
"U OnCircle PO P" and
"V OnCircle PO P"
shows "U V Lt A B"
proof -
have "U V Le A B"
using assms(2) assms(3) assms(4) chord_le_diam by blast
{
assume "Cong U V A B"
obtain O' where "O' Midpoint U V"
using midpoint_existence by blast
have "Cong PO A PO B"
using Diam_def assms(2) onc2__cong by blast
hence "Cong A PO U O'"
by (meson Diam_def \<open>Cong U V A B\<close> \<open>O' Midpoint U V\<close> assms(2)
cong_cong_half_1 cong_symmetry midpoint_def not_cong_2134)
hence "Cong B PO V O'"
by (meson Midpoint_def \<open>Cong PO A PO B\<close> \<open>O' Midpoint U V\<close>
cong_4321 cong_right_commutativity cong_transitivity)
have "Col PO U V"
proof (rule l4_13 [where ?A="PO" and ?B="A" and ?C="B"])
show "Col PO A B"
using Col_def Diam_def assms(2) between_symmetry by blast
show "PO A B Cong3 PO U V"
using Cong3_def Diam_def \<open>Cong U V A B\<close> assms(2)
assms(3) assms(4) cong_symmetry onc2__cong by blast
qed
hence False
by (simp add: assms(1))
}
thus ?thesis
using Lt_def \<open>U V Le A B\<close> by blast
qed
lemma inc2_le_diam:
assumes "Diam A B PO P" and
"U InCircle PO P" and
"V InCircle PO P"
shows "U V Le A B"
proof -
have "Bet A PO B" and "A OnCircle PO P" and "B OnCircle PO P"
using assms(1) Diam_def by auto
obtain W where "Bet U PO W" and "Cong PO W PO V"
using segment_construction by blast
have "U V Le U W"
using \<open>Bet U PO W\<close> \<open>Cong PO W PO V\<close> not_cong_3412 triangle_inequality by blast
have "U W Le A B"
proof (rule bet2_le2__le [where ?P="PO" and ?Q="PO"], insert \<open>Bet A PO B\<close>)
show "Bet U PO W"
by (simp add: \<open>Bet U PO W\<close>)
show "PO U Le PO A"
by (meson InCircle_def OnCircle_def \<open>A OnCircle PO P\<close>
assms(2) between_trivial l5_5_2 le_transitivity onc_sym)
show "PO W Le PO B"
by (meson InCircle_def OnCircle_def \<open>B OnCircle PO P\<close>
\<open>Cong PO W PO V\<close> assms(3) between_trivial l5_5_2 le_transitivity onc_sym)
qed
thus ?thesis
using \<open>U V Le U W\<close> le_transitivity by blast
qed
lemma onc_col_diam__eq:
assumes "Diam A B PO P" and
"X OnCircle PO P" and
"Col A B X"
shows "X = A \<or> X = B"
by (metis Diam_def assms(1) assms(2) assms(3) bet_neq21__neq
cong_reverse_identity line_circle_two_points onc2__cong)
lemma bet_onc_le_a:
assumes "Diam A B PO P" and
"Bet B PO T" and
"X OnCircle PO P"
shows "T A Le T X"
proof -
have "Cong PO X PO A"
using Diam_def assms(1) assms(3) onc2__cong by blast
show ?thesis