src/HOL/Finite_Set.thy
changeset 44919 482f1807976e
parent 44890 22f665a2e91c
child 44928 7ef6505bde7f
equal deleted inserted replaced
44918:6a80fbc4e72c 44919:482f1807976e
   752   assumes "finite A"
   752   assumes "finite A"
   753   shows "inf B (Inf A) = fold inf B A"
   753   shows "inf B (Inf A) = fold inf B A"
   754 proof -
   754 proof -
   755   interpret comp_fun_idem inf by (fact comp_fun_idem_inf)
   755   interpret comp_fun_idem inf by (fact comp_fun_idem_inf)
   756   from `finite A` show ?thesis by (induct A arbitrary: B)
   756   from `finite A` show ?thesis by (induct A arbitrary: B)
   757     (simp_all add: Inf_insert inf_commute fold_fun_comm)
   757     (simp_all add: inf_commute fold_fun_comm)
   758 qed
   758 qed
   759 
   759 
   760 lemma sup_Sup_fold_sup:
   760 lemma sup_Sup_fold_sup:
   761   assumes "finite A"
   761   assumes "finite A"
   762   shows "sup B (Sup A) = fold sup B A"
   762   shows "sup B (Sup A) = fold sup B A"
   763 proof -
   763 proof -
   764   interpret comp_fun_idem sup by (fact comp_fun_idem_sup)
   764   interpret comp_fun_idem sup by (fact comp_fun_idem_sup)
   765   from `finite A` show ?thesis by (induct A arbitrary: B)
   765   from `finite A` show ?thesis by (induct A arbitrary: B)
   766     (simp_all add: Sup_insert sup_commute fold_fun_comm)
   766     (simp_all add: sup_commute fold_fun_comm)
   767 qed
   767 qed
   768 
   768 
   769 lemma Inf_fold_inf:
   769 lemma Inf_fold_inf:
   770   assumes "finite A"
   770   assumes "finite A"
   771   shows "Inf A = fold inf top A"
   771   shows "Inf A = fold inf top A"
   782 proof (rule sym)
   782 proof (rule sym)
   783   interpret comp_fun_idem inf by (fact comp_fun_idem_inf)
   783   interpret comp_fun_idem inf by (fact comp_fun_idem_inf)
   784   interpret comp_fun_idem "inf \<circ> f" by (fact comp_comp_fun_idem)
   784   interpret comp_fun_idem "inf \<circ> f" by (fact comp_comp_fun_idem)
   785   from `finite A` show "?fold = ?inf"
   785   from `finite A` show "?fold = ?inf"
   786     by (induct A arbitrary: B)
   786     by (induct A arbitrary: B)
   787       (simp_all add: INFI_def Inf_insert inf_left_commute)
   787       (simp_all add: INFI_def inf_left_commute)
   788 qed
   788 qed
   789 
   789 
   790 lemma sup_SUPR_fold_sup:
   790 lemma sup_SUPR_fold_sup:
   791   assumes "finite A"
   791   assumes "finite A"
   792   shows "sup B (SUPR A f) = fold (sup \<circ> f) B A" (is "?sup = ?fold") 
   792   shows "sup B (SUPR A f) = fold (sup \<circ> f) B A" (is "?sup = ?fold") 
   793 proof (rule sym)
   793 proof (rule sym)
   794   interpret comp_fun_idem sup by (fact comp_fun_idem_sup)
   794   interpret comp_fun_idem sup by (fact comp_fun_idem_sup)
   795   interpret comp_fun_idem "sup \<circ> f" by (fact comp_comp_fun_idem)
   795   interpret comp_fun_idem "sup \<circ> f" by (fact comp_comp_fun_idem)
   796   from `finite A` show "?fold = ?sup"
   796   from `finite A` show "?fold = ?sup"
   797     by (induct A arbitrary: B)
   797     by (induct A arbitrary: B)
   798       (simp_all add: SUPR_def Sup_insert sup_left_commute)
   798       (simp_all add: SUPR_def sup_left_commute)
   799 qed
   799 qed
   800 
   800 
   801 lemma INFI_fold_inf:
   801 lemma INFI_fold_inf:
   802   assumes "finite A"
   802   assumes "finite A"
   803   shows "INFI A f = fold (inf \<circ> f) top A"
   803   shows "INFI A f = fold (inf \<circ> f) top A"