+definition R_match_tuple ≝ λt1,t2.
+ ∀ls,c,l1,c1,l2,rs,n.
+ is_bit c = true → is_bit c1 = true →
+ only_bits_or_nulls l1 → no_marks l1 → S n = |l1| →
+ table_TM (S n) (〈bar,false〉::〈c1,false〉::l2) →
+ t1 = midtape STape (〈grid,false〉::ls) 〈c,true〉
+ (l1@〈grid,false〉::〈bar,false〉::〈c1,true〉::l2@〈grid,false〉::rs) →
+ (* facciamo match *)
+ (∃l3,newc,mv,l4.
+ 〈bar,false〉::〈c1,false〉::l2 = l3@〈bar,false〉::〈c,false〉::l1@〈comma,false〉::newc@〈comma,false〉::mv::l4 ∧
+ t2 = midtape ? (reverse ? l1@〈c,false〉::〈grid,false〉::ls) 〈grid,false〉
+ (l3@〈bar,false〉::〈c,false〉::l1@〈comma,true〉::newc@〈comma,false〉::mv::l4@〈grid,false〉::rs))
+ ∨
+ (* non facciamo match su nessuna tupla;
+ non specifichiamo condizioni sul nastro di output, perché
+ non eseguiremo altre operazioni, quindi il suo formato non ci interessa *)
+ (current ? t2 = Some ? 〈grid,true〉 ∧
+ ∀l3,newc,mv,l4.
+ 〈bar,false〉::〈c1,false〉::l2 ≠ l3@〈bar,false〉::〈c,false〉::l1@〈comma,false〉::newc@〈comma,false〉::mv::l4).
+
+(* we still haven't proved termination *)
+axiom sem_match_tuple0 : Realize ? match_tuple R_match_tuple0.
+
+axiom Realize_to_Realize :
+ ∀alpha,M,R1,R2.(∀t1,t2.R1 t1 t2 → R2 t1 t2) → Realize alpha M R1 → Realize alpha M R2.
+
+lemma sem_match_tuple : Realize ? match_tuple R_match_tuple.
+generalize in match sem_match_tuple0; @Realize_to_Realize
+#t1 #t2 #HR #ls #c #l1 #c1 #l2 #rs #n #Hc #Hc1 #Hl1bitsnulls #Hl1marks #Hl1len #Htable #Ht1
+cases (HR … Ht1) -HR #_ #HR
+@(HR ??? [] … (refl ??) (refl ??) (refl ??) Hc Hc1 Hl1bitsnulls Hl1marks
+ Hl1len Htable)
+qed.
\ No newline at end of file