diff -r 405f7fd15f4e -r f94b30fa2b6c src/HOL/Library/Extended_Nat.thy --- a/src/HOL/Library/Extended_Nat.thy Sun Nov 03 21:12:50 2024 +0100 +++ b/src/HOL/Library/Extended_Nat.thy Sun Nov 03 22:29:07 2024 +0100 @@ -656,20 +656,21 @@ definition Sup_enat :: "enat set \ enat" where "Sup_enat A = (if A = {} then 0 else if finite A then Max A else \)" + instance proof fix x :: "enat" and A :: "enat set" - { assume "x \ A" then show "Inf A \ x" - unfolding Inf_enat_def by (auto intro: Least_le) } - { assume "\y. y \ A \ x \ y" then show "x \ Inf A" - unfolding Inf_enat_def - by (cases "A = {}") (auto intro: LeastI2_ex) } - { assume "x \ A" then show "x \ Sup A" - unfolding Sup_enat_def by (cases "finite A") auto } - { assume "\y. y \ A \ y \ x" then show "Sup A \ x" - unfolding Sup_enat_def using finite_enat_bounded by auto } -qed (simp_all add: - inf_enat_def sup_enat_def bot_enat_def top_enat_def Inf_enat_def Sup_enat_def) + show "x \ A \ Inf A \ x" + unfolding Inf_enat_def by (auto intro: Least_le) + show "(\y. y \ A \ x \ y) \ x \ Inf A" + unfolding Inf_enat_def + by (cases "A = {}") (auto intro: LeastI2_ex) + show "x \ A \ x \ Sup A" + unfolding Sup_enat_def by (cases "finite A") auto + show "(\y. y \ A \ y \ x) \ Sup A \ x" + unfolding Sup_enat_def using finite_enat_bounded by auto +qed (simp_all add: inf_enat_def sup_enat_def bot_enat_def top_enat_def Inf_enat_def Sup_enat_def) + end instance enat :: complete_linorder ..