1109 "a \<noteq> \<top> \<longleftrightarrow> a < \<top>" |
1109 "a \<noteq> \<top> \<longleftrightarrow> a < \<top>" |
1110 by (auto simp add: less_le_not_le intro!: antisym) |
1110 by (auto simp add: less_le_not_le intro!: antisym) |
1111 |
1111 |
1112 end |
1112 end |
1113 |
1113 |
1114 no_notation |
|
1115 bot ("\<bottom>") and |
|
1116 top ("\<top>") |
|
1117 |
|
1118 |
1114 |
1119 subsection {* Dense orders *} |
1115 subsection {* Dense orders *} |
1120 |
1116 |
1121 class dense_linorder = linorder + |
1117 class dense_linorder = linorder + |
1122 assumes gt_ex: "\<exists>y. x < y" |
1118 assumes gt_ex: "\<exists>y. x < y" |
1259 by simp |
1255 by simp |
1260 |
1256 |
1261 lemma le_boolD: "P \<le> Q \<Longrightarrow> P \<longrightarrow> Q" |
1257 lemma le_boolD: "P \<le> Q \<Longrightarrow> P \<longrightarrow> Q" |
1262 by simp |
1258 by simp |
1263 |
1259 |
1264 lemma bot_boolE: "bot \<Longrightarrow> P" |
1260 lemma bot_boolE: "\<bottom> \<Longrightarrow> P" |
1265 by simp |
1261 by simp |
1266 |
1262 |
1267 lemma top_boolI: top |
1263 lemma top_boolI: \<top> |
1268 by simp |
1264 by simp |
1269 |
1265 |
1270 lemma [code]: |
1266 lemma [code]: |
1271 "False \<le> b \<longleftrightarrow> True" |
1267 "False \<le> b \<longleftrightarrow> True" |
1272 "True \<le> b \<longleftrightarrow> b" |
1268 "True \<le> b \<longleftrightarrow> b" |
1314 |
1310 |
1315 instantiation "fun" :: (type, top) top |
1311 instantiation "fun" :: (type, top) top |
1316 begin |
1312 begin |
1317 |
1313 |
1318 definition |
1314 definition |
1319 [no_atp]: "top = (\<lambda>x. top)" |
1315 [no_atp]: "\<top> = (\<lambda>x. \<top>)" |
1320 declare top_fun_def_raw [no_atp] |
1316 declare top_fun_def_raw [no_atp] |
1321 |
1317 |
1322 lemma top_apply: |
1318 lemma top_apply: |
1323 "top x = top" |
1319 "\<top> x = \<top>" |
1324 by (simp add: top_fun_def) |
1320 by (simp add: top_fun_def) |
1325 |
1321 |
1326 instance proof |
1322 instance proof |
1327 qed (simp add: le_fun_def top_apply) |
1323 qed (simp add: le_fun_def top_apply) |
1328 |
1324 |
1334 lemma le_funE: "f \<le> g \<Longrightarrow> (f x \<le> g x \<Longrightarrow> P) \<Longrightarrow> P" |
1330 lemma le_funE: "f \<le> g \<Longrightarrow> (f x \<le> g x \<Longrightarrow> P) \<Longrightarrow> P" |
1335 unfolding le_fun_def by simp |
1331 unfolding le_fun_def by simp |
1336 |
1332 |
1337 lemma le_funD: "f \<le> g \<Longrightarrow> f x \<le> g x" |
1333 lemma le_funD: "f \<le> g \<Longrightarrow> f x \<le> g x" |
1338 unfolding le_fun_def by simp |
1334 unfolding le_fun_def by simp |
|
1335 |
|
1336 |
|
1337 subsection {* Order on unary and binary predicates *} |
|
1338 |
|
1339 lemma predicate1I: |
|
1340 assumes PQ: "\<And>x. P x \<Longrightarrow> Q x" |
|
1341 shows "P \<le> Q" |
|
1342 apply (rule le_funI) |
|
1343 apply (rule le_boolI) |
|
1344 apply (rule PQ) |
|
1345 apply assumption |
|
1346 done |
|
1347 |
|
1348 lemma predicate1D [Pure.dest?, dest?]: |
|
1349 "P \<le> Q \<Longrightarrow> P x \<Longrightarrow> Q x" |
|
1350 apply (erule le_funE) |
|
1351 apply (erule le_boolE) |
|
1352 apply assumption+ |
|
1353 done |
|
1354 |
|
1355 lemma rev_predicate1D: |
|
1356 "P x \<Longrightarrow> P \<le> Q \<Longrightarrow> Q x" |
|
1357 by (rule predicate1D) |
|
1358 |
|
1359 lemma predicate2I [Pure.intro!, intro!]: |
|
1360 assumes PQ: "\<And>x y. P x y \<Longrightarrow> Q x y" |
|
1361 shows "P \<le> Q" |
|
1362 apply (rule le_funI)+ |
|
1363 apply (rule le_boolI) |
|
1364 apply (rule PQ) |
|
1365 apply assumption |
|
1366 done |
|
1367 |
|
1368 lemma predicate2D [Pure.dest, dest]: |
|
1369 "P \<le> Q \<Longrightarrow> P x y \<Longrightarrow> Q x y" |
|
1370 apply (erule le_funE)+ |
|
1371 apply (erule le_boolE) |
|
1372 apply assumption+ |
|
1373 done |
|
1374 |
|
1375 lemma rev_predicate2D: |
|
1376 "P x y \<Longrightarrow> P \<le> Q \<Longrightarrow> Q x y" |
|
1377 by (rule predicate2D) |
|
1378 |
|
1379 lemma bot1E [no_atp, elim!]: "\<bottom> x \<Longrightarrow> P" |
|
1380 by (simp add: bot_fun_def) |
|
1381 |
|
1382 lemma bot2E [elim!]: "\<bottom> x y \<Longrightarrow> P" |
|
1383 by (simp add: bot_fun_def) |
|
1384 |
|
1385 lemma top1I [intro!]: "\<top> x" |
|
1386 by (simp add: top_fun_def) |
|
1387 |
|
1388 lemma top2I [intro!]: "\<top> x y" |
|
1389 by (simp add: top_fun_def) |
1339 |
1390 |
1340 |
1391 |
1341 subsection {* Name duplicates *} |
1392 subsection {* Name duplicates *} |
1342 |
1393 |
1343 lemmas order_eq_refl = preorder_class.eq_refl |
1394 lemmas order_eq_refl = preorder_class.eq_refl |