src/HOL/Library/Permutations.thy
changeset 63539 70d4d9e5707b
parent 63148 6a767355d1a9
child 63921 0a5184877cb7
equal deleted inserted replaced
63533:42b6186fc0e4 63539:70d4d9e5707b
  1267   assume eq: "map_of xs x = map_of xs y"
  1267   assume eq: "map_of xs x = map_of xs y"
  1268   from xy obtain x' y' 
  1268   from xy obtain x' y' 
  1269     where x'y': "map_of xs x = Some x'" "map_of xs y = Some y'" 
  1269     where x'y': "map_of xs x = Some x'" "map_of xs y = Some y'" 
  1270     by (cases "map_of xs x"; cases "map_of xs y")
  1270     by (cases "map_of xs x"; cases "map_of xs y")
  1271        (simp_all add: map_of_eq_None_iff)
  1271        (simp_all add: map_of_eq_None_iff)
  1272   moreover from this x'y' have "(x,x') \<in> set xs" "(y,y') \<in> set xs"
  1272   moreover from x'y' have *: "(x,x') \<in> set xs" "(y,y') \<in> set xs"
  1273     by (force dest: map_of_SomeD)+
  1273     by (force dest: map_of_SomeD)+
  1274   moreover from this eq x'y' have "x' = y'" by simp
  1274   moreover from * eq x'y' have "x' = y'" by simp
  1275   ultimately show "x = y" using assms
  1275   ultimately show "x = y" using assms
  1276     by (force simp: distinct_map dest: inj_onD[of _ _ "(x,x')" "(y,y')"])
  1276     by (force simp: distinct_map dest: inj_onD[of _ _ "(x,x')" "(y,y')"])
  1277 qed
  1277 qed
  1278 
  1278 
  1279 lemma inj_on_the: "None \<notin> A \<Longrightarrow> inj_on the A"
  1279 lemma inj_on_the: "None \<notin> A \<Longrightarrow> inj_on the A"