src/HOL/Induct/Mutil.ML
changeset 8703 816d8f6513be
parent 8589 a24f7e5ee7ef
child 8781 d0c2bd57a9fb
equal deleted inserted replaced
8702:78b7010db847 8703:816d8f6513be
    30 by Auto_tac;
    30 by Auto_tac;
    31 qed "below_0";
    31 qed "below_0";
    32 Addsimps [below_0];
    32 Addsimps [below_0];
    33 
    33 
    34 Goalw [below_def]
    34 Goalw [below_def]
    35     "below(Suc n) Times B = ({n} Times B) Un ((below n) Times B)";
    35     "below(Suc n) <*> B = ({n} <*> B) Un ((below n) <*> B)";
    36 by Auto_tac;
    36 by Auto_tac;
    37 qed "Sigma_Suc1";
    37 qed "Sigma_Suc1";
    38 
    38 
    39 Goalw [below_def]
    39 Goalw [below_def]
    40     "A Times below(Suc n) = (A Times {n}) Un (A Times (below n))";
    40     "A <*> below(Suc n) = (A <*> {n}) Un (A <*> (below n))";
    41 by Auto_tac;
    41 by Auto_tac;
    42 qed "Sigma_Suc2";
    42 qed "Sigma_Suc2";
    43 
    43 
    44 Addsimps [Sigma_Suc1, Sigma_Suc2];
    44 Addsimps [Sigma_Suc1, Sigma_Suc2];
    45 
    45 
    46 Goal "({i} Times {n}) Un ({i} Times {m}) = {(i,m), (i,n)}";
    46 Goal "({i} <*> {n}) Un ({i} <*> {m}) = {(i,m), (i,n)}";
    47 by Auto_tac;
    47 by Auto_tac;
    48 qed "sing_Times_lemma";
    48 qed "sing_Times_lemma";
    49 
    49 
    50 Goal "{i} Times below(n+n) : tiling domino";
    50 Goal "{i} <*> below(n+n) : tiling domino";
    51 by (induct_tac "n" 1);
    51 by (induct_tac "n" 1);
    52 by (ALLGOALS (asm_simp_tac (simpset() addsimps [Un_assoc RS sym])));
    52 by (ALLGOALS (asm_simp_tac (simpset() addsimps [Un_assoc RS sym])));
    53 by (rtac tiling.Un 1);
    53 by (rtac tiling.Un 1);
    54 by (ALLGOALS (asm_simp_tac (simpset() addsimps [sing_Times_lemma])));
    54 by (ALLGOALS (asm_simp_tac (simpset() addsimps [sing_Times_lemma])));
    55 qed "dominoes_tile_row";
    55 qed "dominoes_tile_row";
    56 
    56 
    57 AddSIs [dominoes_tile_row]; 
    57 AddSIs [dominoes_tile_row]; 
    58 
    58 
    59 Goal "(below m) Times below(n+n) : tiling domino";
    59 Goal "(below m) <*> below(n+n) : tiling domino";
    60 by (induct_tac "m" 1);
    60 by (induct_tac "m" 1);
    61 by Auto_tac;
    61 by Auto_tac;
    62 qed "dominoes_tile_matrix";
    62 qed "dominoes_tile_matrix";
    63 
    63 
    64 
    64 
   119 by (ALLGOALS (force_tac (claset() addSIs [card_Diff1_less], 
   119 by (ALLGOALS (force_tac (claset() addSIs [card_Diff1_less], 
   120 			 simpset() addsimps [colored_def])));
   120 			 simpset() addsimps [colored_def])));
   121 qed "gen_mutil_not_tiling";
   121 qed "gen_mutil_not_tiling";
   122 
   122 
   123 (*Apply the general theorem to the well-known case*)
   123 (*Apply the general theorem to the well-known case*)
   124 Goal "[| t = below(Suc m + Suc m) Times below(Suc n + Suc n) |] \
   124 Goal "[| t = below(Suc m + Suc m) <*> below(Suc n + Suc n) |] \
   125 \     ==> t - {(0,0)} - {(Suc(m+m), Suc(n+n))} ~: tiling domino";
   125 \     ==> t - {(0,0)} - {(Suc(m+m), Suc(n+n))} ~: tiling domino";
   126 by (rtac gen_mutil_not_tiling 1);
   126 by (rtac gen_mutil_not_tiling 1);
   127 by (blast_tac (claset() addSIs [dominoes_tile_matrix]) 1);
   127 by (blast_tac (claset() addSIs [dominoes_tile_matrix]) 1);
   128 by Auto_tac;
   128 by Auto_tac;
   129 qed "mutil_not_tiling";
   129 qed "mutil_not_tiling";