@@ -96,35 +96,36 @@ theorem derives_strings {α: Type} (R: Lang α) (xs ys: List α):
96
96
97
97
theorem derives_step {α: Type } (R: Lang α) (x: α) (xs: List α):
98
98
derives R (x :: xs) = derives (derive R x) xs := by
99
- simp
99
+ simp only [derive]
100
100
rw [<- derives_strings]
101
101
congr
102
102
103
103
theorem null_derives {α: Type } (R: Lang α) (xs: List α):
104
104
(null ∘ derives R) xs = R xs := by
105
105
unfold derives
106
106
unfold null
107
- simp
107
+ simp only [Function.comp_apply]
108
+ simp only [append_nil]
108
109
109
110
theorem validate {α: Type } (R: Lang α) (xs: List α):
110
111
null (derives R xs) = R xs := by
111
112
unfold derives
112
113
unfold null
113
- simp
114
+ simp only [append_nil]
114
115
115
116
theorem derives_foldl (R: Lang α) (xs: List α):
116
117
(derives R) xs = (List.foldl derive R) xs := by
117
118
revert R
118
119
induction xs with
119
120
| nil =>
120
121
unfold derives
121
- simp
122
+ simp only [nil_append, foldl_nil, implies_true]
122
123
| cons x xs ih =>
123
124
simp
124
125
intro R
125
126
rw [derives_step]
126
127
rw [ih (derive R x)]
127
- simp
128
+ simp only [derive]
128
129
129
130
-- Theorems: null
130
131
@@ -199,8 +200,8 @@ theorem null_iff_concat {α: Type} {P Q: Lang α}:
199
200
refine Iff.intro ?toFun ?invFun
200
201
case toFun =>
201
202
intro ⟨x, y, hx, hy, hxy⟩
202
- simp at hxy
203
- simp [hxy] at hx hy
203
+ simp only [nil_eq, append_eq_nil] at hxy
204
+ simp only [hxy] at hx hy
204
205
exact ⟨hx, hy⟩
205
206
case invFun =>
206
207
exact fun ⟨x, y⟩ => ⟨[], [], x, y, rfl⟩
@@ -386,7 +387,7 @@ theorem derive_iff_star {α: Type} {x: α} {R: Lang α} {xs: List α}:
386
387
unfold concat
387
388
exists xs1
388
389
exists xs2
389
- simp at hxs
390
+ simp only [singleton_append, cons_append, cons.injEq] at hxs
390
391
cases hxs with
391
392
| intro hxs1 hxs2 =>
392
393
rw [hxs1]
@@ -409,7 +410,7 @@ theorem derive_iff_star {α: Type} {x: α} {R: Lang α} {xs: List α}:
409
410
unfold derives
410
411
refine star.more x xs1 xs2 ?hxs ?e ?f ?g
411
412
· rw [hxs]
412
- simp
413
+ simp only [singleton_append, cons_append, nil_append]
413
414
· apply deriveRxxs1
414
415
· exact starRxs2
415
416
@@ -529,10 +530,10 @@ theorem simp_or_null_l_emptystr_is_l
529
530
(nullr: null r):
530
531
or r emptystr = r := by
531
532
unfold or
532
- simp
533
+ simp only [emptystr]
533
534
unfold null at nullr
534
535
funext xs
535
- simp
536
+ simp only [eq_iff_iff, or_iff_left_iff_imp]
536
537
intro hxs
537
538
rw [hxs]
538
539
exact nullr
@@ -542,10 +543,10 @@ theorem simp_or_emptystr_null_r_is_r
542
543
(nullr: null r):
543
544
or emptystr r = r := by
544
545
unfold or
545
- simp
546
+ simp only [emptystr]
546
547
unfold null at nullr
547
548
funext xs
548
- simp
549
+ simp only [eq_iff_iff, or_iff_right_iff_imp]
549
550
intro hxs
550
551
rw [hxs]
551
552
exact nullr
@@ -560,7 +561,7 @@ theorem simp_or_comm (r s: Lang α):
560
561
or r s = or s r := by
561
562
unfold or
562
563
funext xs
563
- simp
564
+ simp only [eq_iff_iff]
564
565
apply Iff.intro
565
566
case mp =>
566
567
intro h
@@ -619,31 +620,31 @@ theorem simp_or_assoc (r s t: Lang α):
619
620
theorem simp_and_emptyset_l_is_emptyset (r: Lang α):
620
621
and emptyset r = emptyset := by
621
622
unfold and
622
- simp
623
+ simp only [emptyset, false_and]
623
624
rfl
624
625
625
626
theorem simp_and_emptyset_r_is_emptyset (r: Lang α):
626
627
and r emptyset = emptyset := by
627
628
unfold and
628
- simp
629
+ simp only [emptyset, and_false]
629
630
rfl
630
631
631
632
theorem simp_and_universal_l_is_r (r: Lang α):
632
633
and universal r = r := by
633
634
unfold and
634
- simp
635
+ simp only [universal, true_and]
635
636
636
637
theorem simp_and_universal_r_is_l (r: Lang α):
637
638
and r universal = r := by
638
639
unfold and
639
- simp
640
+ simp only [universal, and_true]
640
641
641
642
theorem simp_and_null_l_emptystr_is_emptystr
642
643
(r: Lang α)
643
644
(nullr: null r):
644
645
and r emptystr = emptystr := by
645
646
funext xs
646
- simp at *
647
+ simp only [null, and, emptystr, eq_iff_iff, and_iff_right_iff_imp]
647
648
intro hxs
648
649
rw [hxs]
649
650
exact nullr
@@ -653,7 +654,8 @@ theorem simp_and_emptystr_null_r_is_emptystr
653
654
(nullr: null r):
654
655
and emptystr r = emptystr := by
655
656
funext xs
656
- simp at *
657
+ simp only [null] at nullr
658
+ simp only [and, emptystr, eq_iff_iff, and_iff_left_iff_imp]
657
659
intro hxs
658
660
rw [hxs]
659
661
exact nullr
@@ -663,7 +665,7 @@ theorem simp_and_not_null_l_emptystr_is_emptyset
663
665
(notnullr: Not (null r)):
664
666
and r emptystr = emptyset := by
665
667
funext xs
666
- simp at *
668
+ simp only [null, and, emptystr, emptyset, eq_iff_iff, iff_false, not_and]
667
669
intro hr hxs
668
670
rw [hxs] at hr
669
671
contradiction
@@ -673,21 +675,30 @@ theorem simp_and_emptystr_not_null_r_is_emptyset
673
675
(notnullr: Not (null r)):
674
676
and emptystr r = emptyset := by
675
677
funext xs
676
- simp at *
678
+ simp only [null, and, emptystr, emptyset, eq_iff_iff, iff_false, not_and]
677
679
intro hxs
678
680
rw [hxs]
679
681
exact notnullr
680
682
681
683
theorem simp_and_idemp (r: Lang α):
682
684
and r r = r := by
683
685
unfold and
684
- simp
686
+ funext xs
687
+ simp only [eq_iff_iff]
688
+ apply Iff.intro
689
+ case mp =>
690
+ intro h
691
+ cases h
692
+ assumption
693
+ case mpr =>
694
+ intro h
695
+ exact And.intro h h
685
696
686
697
theorem simp_and_comm (r s: Lang α):
687
698
and r s = and s r := by
688
699
unfold and
689
700
funext xs
690
- simp
701
+ simp only [eq_iff_iff]
691
702
apply Iff.intro
692
703
case mp =>
693
704
intro h
@@ -720,7 +731,7 @@ theorem simp_and_assoc (r s t: Lang α):
720
731
theorem simp_not_not_is_double_negation (r: Lang α):
721
732
not (not r) = r := by
722
733
unfold not
723
- simp
734
+ simp only [not_not]
724
735
725
736
theorem simp_not_and_demorgen (r s: Lang α):
726
737
not (and r s) = or (not r) (not s) := by
@@ -744,7 +755,7 @@ theorem simp_not_and_demorgen (r s: Lang α):
744
755
intro hrs
745
756
cases hrs with
746
757
| intro hr hs =>
747
- simp at h
758
+ simp only [imp_false] at h
748
759
cases h with
749
760
| inl h =>
750
761
contradiction
@@ -763,7 +774,7 @@ theorem simp_and_not_emptystr_l_not_null_r_is_r
763
774
(notnullr: Not (null r)):
764
775
and (not emptystr) r = r := by
765
776
funext xs
766
- simp [ not, emptystr] at *
777
+ simp only [null, and, not, emptystr, eq_iff_iff, and_iff_right_iff_imp]
767
778
intro hr hxs
768
779
rw [hxs] at hr
769
780
contradiction
@@ -773,7 +784,8 @@ theorem simp_and_not_null_l_not_emptystr_r_is_l
773
784
(notnullr: Not (null r)):
774
785
and r (not emptystr) = r := by
775
786
funext xs
776
- simp [not, emptystr] at *
787
+ simp only [null] at notnullr
788
+ simp only [and, not, emptystr, eq_iff_iff, and_iff_left_iff_imp]
777
789
intro hr hxs
778
790
rw [hxs] at hr
779
791
contradiction
@@ -785,7 +797,7 @@ theorem simp_one_r_implies_star_r (r: Lang α) (xs: List α):
785
797
· exact star.zero
786
798
· case cons x xs =>
787
799
apply star.more x xs []
788
- · simp
800
+ · simp only [append_nil]
789
801
· exact h
790
802
· exact star.zero
791
803
@@ -804,13 +816,13 @@ theorem simp_star_concat_star_implies_star (r: Lang α) (xs: List α):
804
816
clear xssplit
805
817
induction starrxs1 with
806
818
| zero =>
807
- simp
819
+ simp only [nil_append]
808
820
exact starrxs2
809
821
| more x xs11 xs12 _ xs1split rxxs11 starrxs12 ih =>
810
822
rename_i xs1
811
823
rw [xs1split]
812
824
apply star.more x xs11 (xs12 ++ xs2)
813
- simp
825
+ simp only [cons_append, append_assoc]
814
826
exact rxxs11
815
827
exact ih
816
828
@@ -825,14 +837,14 @@ theorem simp_star_implies_star_concat_star (r: Lang α) (xs: List α):
825
837
split_ands
826
838
· exact star.zero
827
839
· exact star.zero
828
- · simp
840
+ · simp only [append_nil]
829
841
| more x xs1 xs2 _ xssplit rxxs1 starrxs2 =>
830
842
unfold concat
831
843
exists (x::xs1)
832
844
exists xs2
833
845
split_ands
834
846
· refine star.more x xs1 [] _ ?_ ?_ ?_
835
- · simp
847
+ · simp only [append_nil]
836
848
· exact rxxs1
837
849
· exact star.zero
838
850
· exact starrxs2
@@ -882,7 +894,7 @@ theorem simp_star_star_is_star (r: Lang α):
882
894
theorem simp_star_emptystr_is_emptystr {α: Type }:
883
895
star (@emptystr α) = (@emptystr α) := by
884
896
funext xs
885
- simp
897
+ simp only [emptystr, eq_iff_iff]
886
898
apply Iff.intro
887
899
case mp =>
888
900
intro h
@@ -899,7 +911,7 @@ theorem simp_star_emptystr_is_emptystr {α: Type}:
899
911
theorem simp_star_emptyset_is_emptystr {α: Type }:
900
912
star (@emptyset α) = (@emptystr α) := by
901
913
funext xs
902
- simp
914
+ simp only [emptystr, eq_iff_iff]
903
915
apply Iff.intro
904
916
case mp =>
905
917
intro h
0 commit comments