diff -r 518a1464f1ac -r 791c44b1d130 src/HOL/Groups_List.thy --- a/src/HOL/Groups_List.thy Sun Nov 02 20:01:43 2025 +0100 +++ b/src/HOL/Groups_List.thy Sun Nov 02 20:36:24 2025 +0100 @@ -57,22 +57,30 @@ finally show ?thesis . qed +lemma atLeastAtMost_conv_list [code_unfold]: + \set.F g {a..b} = list.F (map g (List.interval a b))\ + by (simp flip: List.set_interval_eq add: distinct_set_conv_list) + lemma atLeastLessThan_conv_list [code_unfold]: - \set.F g {a.. - using List.atLeastLessThan_eq_range - by (simp flip: List.set_range_eq add: distinct_set_conv_list) + \set.F g {a..1)\ + using List.atLeastLessThan_eq_interval [of a b] + by (simp flip: List.set_interval_eq add: distinct_set_conv_list Let_def) -lemma atLeastAtMost_conv_list [code_unfold]: - \set.F g {a..b} = list.F (map g (List.range a (b + 1)))\ - by (simp flip: List.set_range_eq add: List.atLeastAtMost_eq_range distinct_set_conv_list) +lemma greaterThanAtMost_conv_list [code_unfold]: + \set.F g {a<..b} = (let c = a + 1 in if a < c + then list.F (map g (List.interval c b)) + else \<^bold>1)\ + using List.greaterThanAtMost_eq_interval [of a b] + by (simp flip: List.set_interval_eq add: distinct_set_conv_list Let_def) lemma greaterThanLessThan_conv_list [code_unfold]: - \set.F g {a<.. - by (simp flip: List.set_range_eq add: List.greaterThanLessThan_eq_range distinct_set_conv_list) - -lemma greaterThanAtMost_conv_list [code_unfold]: - \set.F g {a<..b} = list.F (map g (List.range (a + 1) (b + 1)))\ - by (simp flip: List.set_range_eq add: List.greaterThanAtMost_eq_range distinct_set_conv_list) + \set.F g {a<.. d < b + then list.F (map g (List.interval (a + 1) (b - 1))) + else \<^bold>1)\ + using List.greaterThanLessThan_eq_interval [of a b] + by (simp flip: List.set_interval_eq add: distinct_set_conv_list Let_def) end