Skip to content

Commit dd0a5d7

Browse files
committed
Stage work on solvable_iff_has_hnf
1 parent 27421e2 commit dd0a5d7

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

examples/lambda/barendregt/solvableScript.sml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ open arithmeticTheory pred_setTheory listTheory sortingTheory finite_mapTheory
1010

1111
(* lambda theories *)
1212
open termTheory appFOLDLTheory chap2Theory chap3Theory standardisationTheory
13-
reductionEval;
13+
head_reductionTheory reductionEval;
1414

1515
val _ = new_theory "solvable";
1616

@@ -486,7 +486,7 @@ QED
486486

487487
Theorem ssub_LAM[local] = List.nth(CONJUNCTS ssub_thm, 2)
488488

489-
(* Lemma 8.3.3 (ii) *)
489+
(* Lemma 8.3.3 (ii) [1, p.172] *)
490490
Theorem solvable_iff_LAM[simp] :
491491
!x M. solvable (LAM x M) <=> solvable M
492492
Proof
@@ -606,6 +606,46 @@ Proof
606606
Q.EXISTS_TAC ‘fm’ >> simp [] ] ]
607607
QED
608608

609+
(* Proposition 8.3.13 (iii) [1, p.174] *)
610+
Theorem solvable_iff_APP :
611+
!M N. has_hnf (M @@ N) <=> has_hnf M
612+
Proof
613+
cheat
614+
QED
615+
616+
(* Theorem 8.3.14 (Wadsworth) [1, p.175] *)
617+
Theorem solvable_iff_has_hnf :
618+
!M. solvable M <=> has_hnf M
619+
Proof
620+
Q.X_GEN_TAC ‘M’
621+
>> Q.ABBREV_TAC ‘vs = SET_TO_LIST (FV M)’
622+
>> Q.ABBREV_TAC ‘M0 = LAMl vs M’
623+
>> ‘closed M0’
624+
by (rw [closed_def, Abbr ‘M0’, Abbr ‘vs’, FV_LAMl, SET_TO_LIST_INV])
625+
>> Suff ‘solvable M0 <=> has_hnf M0’
626+
>- (Q.UNABBREV_TAC ‘M0’ \\
627+
KILL_TAC >> Induct_on ‘vs’ >- rw [] \\
628+
rw [solvable_iff_LAM, has_hnf_iff_LAM])
629+
>> POP_ASSUM MP_TAC
630+
>> KILL_TAC
631+
>> Q.SPEC_TAC (‘M0’, ‘M’)
632+
(* stage work, now M is closed *)
633+
>> rpt STRIP_TAC
634+
>> EQ_TAC
635+
>- (rw [solvable_alt_closed] \\
636+
Know ‘has_hnf (M @* Ns)’
637+
>- (rw [has_hnf_def] \\
638+
Q.EXISTS_TAC ‘I’ >> rw [hnf_I]) \\
639+
Q.ID_SPEC_TAC ‘Ns’ >> KILL_TAC \\
640+
HO_MATCH_MP_TAC SNOC_INDUCT >> rw [SNOC_APPEND, SYM appstar_SNOC] \\
641+
FIRST_X_ASSUM MATCH_MP_TAC \\
642+
FULL_SIMP_TAC std_ss [solvable_iff_APP])
643+
(* stage work *)
644+
>> rw [has_hnf_def, solvable_alt_closed]
645+
>> ‘?vs y Ns. N = LAMl vs (VAR y @* Ns)’ by METIS_TAC [hnf_cases]
646+
>> cheat
647+
QED
648+
609649
val _ = export_theory ();
610650
val _ = html_theory "solvable";
611651

0 commit comments

Comments
 (0)