# HG changeset patch
# User noschinl
# Date 1378457847 -7200
# Node ID d2a7b6fe953e99f7398e8d75e1b93100ce5d2343
# Parent d92578436d470d186151fb80376334af24c3d2e3# Parent f5b1f555b73badcc58c4ded2950809c5f845ecaf
merged
diff -r d92578436d47 -r d2a7b6fe953e Admin/Release/CHECKLIST
--- a/Admin/Release/CHECKLIST Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/Release/CHECKLIST Fri Sep 06 10:57:27 2013 +0200
@@ -7,8 +7,6 @@
- test polyml-5.4.1, polyml-5.4.0, polyml-5.3.0, smlnj;
-- test scala-2.9.2;
-
- test Proof General 4.1, 3.7.1.1;
- test 'display_drafts' command;
@@ -27,8 +25,7 @@
- update https://isabelle.in.tum.de/repos/website;
-- maintain Docs:
- doc/Contents
+- maintain doc/Contents;
- maintain Logics:
ROOTS
diff -r d92578436d47 -r d2a7b6fe953e Admin/Windows/Installer/sfx.txt
--- a/Admin/Windows/Installer/sfx.txt Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/Windows/Installer/sfx.txt Fri Sep 06 10:57:27 2013 +0200
@@ -5,5 +5,5 @@
ExtractPathText="Target directory"
ExtractTitle="Unpacking {ISABELLE_NAME} ..."
Shortcut="Du,{%%T\{ISABELLE_NAME}\{ISABELLE_NAME}.exe},{},{},{},{{ISABELLE_NAME}},{%%T\{ISABELLE_NAME}}"
-RunProgram="\"%%T\{ISABELLE_NAME}\{ISABELLE_NAME}.exe\" -i"
+RunProgram="\"%%T\{ISABELLE_NAME}\{ISABELLE_NAME}.exe\""
;!@InstallEnd@!
diff -r d92578436d47 -r d2a7b6fe953e Admin/Windows/launch4j/isabelle.xml
--- a/Admin/Windows/launch4j/isabelle.xml Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/Windows/launch4j/isabelle.xml Fri Sep 06 10:57:27 2013 +0200
@@ -20,11 +20,11 @@
%EXEDIR%\lib\classes\ext\scala-swing.jar
- %EXEDIR%\contrib\jdk-7u21\x86-cygwin\jdk1.7.0_21
+ %EXEDIR%\contrib\jdk\x86-cygwin
jdkOnly
- -Disabelle.home="%EXEDIR%" -Dcygwin.root="%EXEDIR%\\contrib\\cygwin"
+ -Disabelle.home="%EXEDIR%"
isabelle.bmp
diff -r d92578436d47 -r d2a7b6fe953e Admin/components/bundled-windows
--- a/Admin/components/bundled-windows Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/components/bundled-windows Fri Sep 06 10:57:27 2013 +0200
@@ -1,3 +1,3 @@
#additional components to be bundled for release
cygwin-20130117
-windows_app-20130716
+windows_app-20130905
diff -r d92578436d47 -r d2a7b6fe953e Admin/components/components.sha1
--- a/Admin/components/components.sha1 Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/components/components.sha1 Fri Sep 06 10:57:27 2013 +0200
@@ -18,6 +18,7 @@
38d2d2a91c66714c18430e136e7e5191af3996e6 jdk-7u11.tar.gz
d765bc4ad2f34d494429b2a8c1563c49db224944 jdk-7u13.tar.gz
13a265e4b706ece26fdfa6fc9f4a3dd1366016d2 jdk-7u21.tar.gz
+5080274f8721a18111a7f614793afe6c88726739 jdk-7u25.tar.gz
ec740ee9ffd43551ddf1e5b91641405116af6291 jdk-7u6.tar.gz
7d5b152ac70f720bb9e783fa45ecadcf95069584 jdk-7u9.tar.gz
44775a22f42a9d665696bfb49e53c79371c394b0 jedit_build-20111217.tar.gz
@@ -31,6 +32,7 @@
8fa0c67f59beba369ab836562eed4e56382f672a jedit_build-20121201.tar.gz
06e9be2627ebb95c45a9bcfa025d2eeef086b408 jedit_build-20130104.tar.gz
c85c0829b8170f25aa65ec6852f505ce2a50639b jedit_build-20130628.tar.gz
+5de3e399be2507f684b49dfd13da45228214bbe4 jedit_build-20130905.tar.gz
8122526f1fc362ddae1a328bdbc2152853186fee jfreechart-1.0.14.tar.gz
6c737137cc597fc920943783382e928ea79e3feb kodkodi-1.2.16.tar.gz
5f95c96bb99927f3a026050f85bd056f37a9189e kodkodi-1.5.2.tar.gz
@@ -52,6 +54,7 @@
1f4a2053cc1f34fa36c4d9d2ac906ad4ebc863fd sumatra_pdf-2.1.1.tar.gz
869ea6d8ea35c8ba68d7fcb028f16b2b7064c5fd vampire-1.0.tar.gz
81d21dfd0ea5c58f375301f5166be9dbf8921a7a windows_app-20130716.tar.gz
+fe15e1079cf5ad86f3cbab4553722a0d20002d11 windows_app-20130905.tar.gz
2ae13aa17d0dc95ce254a52f1dba10929763a10d xz-java-1.2.tar.gz
4530a1aa6f4498ee3d78d6000fa71a3f63bd077f yices-1.0.28.tar.gz
12ae71acde43bd7bed1e005c43034b208c0cba4c z3-3.2.tar.gz
diff -r d92578436d47 -r d2a7b6fe953e Admin/components/main
--- a/Admin/components/main Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/components/main Fri Sep 06 10:57:27 2013 +0200
@@ -3,8 +3,8 @@
e-1.8
exec_process-1.0.3
Haskabelle-2013
-jdk-7u21
-jedit_build-20130628
+jdk-7u25
+jedit_build-20130905
jfreechart-1.0.14
kodkodi-1.5.2
polyml-5.5.0-3
diff -r d92578436d47 -r d2a7b6fe953e Admin/java/build
--- a/Admin/java/build Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/java/build Fri Sep 06 10:57:27 2013 +0200
@@ -11,8 +11,8 @@
## parameters
-VERSION="7u21"
-FULL_VERSION="1.7.0_21"
+VERSION="7u25"
+FULL_VERSION="1.7.0_25"
ARCHIVE_LINUX32="jdk-${VERSION}-linux-i586.tar.gz"
ARCHIVE_LINUX64="jdk-${VERSION}-linux-x64.tar.gz"
@@ -37,8 +37,6 @@
Linux, Mac OS X, Windows work uniformly, depending on certain
platform-specific subdirectories.
-
-Note that Java 1.7 on Mac OS X requires 64bit hardware!
EOF
@@ -53,10 +51,10 @@
echo "### Java 1.7 unavailable on 32bit Macintosh!" >&2
;;
x86_64-darwin)
- ISABELLE_JDK_HOME="\$COMPONENT/\$ISABELLE_PLATFORM64/jdk${FULL_VERSION}.jdk/Contents/Home"
+ ISABELLE_JDK_HOME="\$COMPONENT/\$ISABELLE_PLATFORM64/Contents/Home"
;;
*)
- ISABELLE_JDK_HOME="\$COMPONENT/\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM32}/jdk${FULL_VERSION}"
+ ISABELLE_JDK_HOME="\$COMPONENT/\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM32}"
;;
esac
@@ -82,6 +80,18 @@
tar -C "$DIR/x86_64-darwin" -xf "$ARCHIVE_DARWIN"
tar -C "$DIR/x86-cygwin" -xf "$ARCHIVE_WINDOWS"
+(
+ cd "$DIR"
+ for PLATFORM in x86-linux x86_64-linux x86-cygwin
+ do
+ mv "$PLATFORM/jdk${FULL_VERSION}"/* "$PLATFORM"/.
+ rmdir "$PLATFORM/jdk${FULL_VERSION}"
+ done
+ PLATFORM=x86_64-darwin
+ mv "$PLATFORM/jdk${FULL_VERSION}.jdk"/* "$PLATFORM"/.
+ rmdir "$PLATFORM/jdk${FULL_VERSION}.jdk"
+)
+
chgrp -R isabelle "$DIR"
chmod -R a+r "$DIR"
chmod -R a+X "$DIR"
@@ -90,13 +100,13 @@
echo "Sharing ..."
(
- cd "$DIR/x86-linux/jdk${FULL_VERSION}"
+ cd "$DIR/x86-linux"
for FILE in $(find . -type f)
do
for OTHER in \
- "../../x86_64-linux/jdk${FULL_VERSION}/$FILE" \
- "../../x86_64-darwin/jdk${FULL_VERSION}.jdk/Contents/Home/$FILE" \
- "../../x86-cygwin/jdk${FULL_VERSION}/$FILE"
+ "../../x86_64-linux/$FILE" \
+ "../../x86_64-darwin/Contents/Home/$FILE" \
+ "../../x86-cygwin/$FILE"
do
if cmp -s "$FILE" "$OTHER"
then
diff -r d92578436d47 -r d2a7b6fe953e Admin/lib/Tools/makedist_bundle
--- a/Admin/lib/Tools/makedist_bundle Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/lib/Tools/makedist_bundle Fri Sep 06 10:57:27 2013 +0200
@@ -48,7 +48,7 @@
ISABELLE_TARGET="$TMP/$ISABELLE_NAME"
-tar -C "$TMP" -x -z -f "$ARCHIVE"
+tar -C "$TMP" -x -z -f "$ARCHIVE" || exit 2
# bundled components
@@ -83,10 +83,18 @@
perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2
fi
- tar -C "$ISABELLE_TARGET/contrib" -x -z -f "$CONTRIB"
+ tar -C "$ISABELLE_TARGET/contrib" -x -z -f "$CONTRIB" || exit 2
if [ -f "$COMPONENT_DIR/etc/settings" -o -f "$COMPONENT_DIR/etc/components" ]
then
- echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components"
+ case "$COMPONENT" in
+ jdk-*)
+ mv "$ISABELLE_TARGET/contrib/$COMPONENT" "$ISABELLE_TARGET/contrib/jdk"
+ echo "contrib/jdk" >> "$ISABELLE_TARGET/etc/components"
+ ;;
+ *)
+ echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components"
+ ;;
+ esac
fi
;;
esac
@@ -154,6 +162,8 @@
find . -type l -exec echo "{}" ";" -exec readlink "{}" ";" \
> "contrib/cygwin/isabelle/symlinks"
+
+ touch "contrib/cygwin/isabelle/uninitialized"
)
perl -pi -e "s,/bin/rebaseall.*,/isabelle/rebaseall,g;" \
@@ -202,7 +212,7 @@
cp -R "$APP_TEMPLATE/Resources/." "$APP/Contents/Resources/."
cp "$APP_TEMPLATE/../isabelle.icns" "$APP/Contents/Resources/."
- ln -sf "../Resources/${ISABELLE_NAME}/contrib/jdk-7u21/x86_64-darwin/jdk1.7.0_21.jdk" \
+ ln -sf "../Resources/${ISABELLE_NAME}/contrib/jdk/x86_64-darwin" \
"$APP/Contents/PlugIns/jdk"
cp macos_app/JavaAppLauncher "$APP/Contents/MacOS/." && \
diff -r d92578436d47 -r d2a7b6fe953e Admin/lib/Tools/update_keywords
--- a/Admin/lib/Tools/update_keywords Fri Sep 06 10:56:40 2013 +0200
+++ b/Admin/lib/Tools/update_keywords Fri Sep 06 10:57:27 2013 +0200
@@ -3,6 +3,7 @@
# Author: Makarius
#
# DESCRIPTION: update standard keyword files for Emacs Proof General
+# (Proof General legacy)
isabelle_admin_build jars || exit $?
diff -r d92578436d47 -r d2a7b6fe953e CONTRIBUTORS
--- a/CONTRIBUTORS Fri Sep 06 10:56:40 2013 +0200
+++ b/CONTRIBUTORS Fri Sep 06 10:57:27 2013 +0200
@@ -6,7 +6,11 @@
Contributions to this Isabelle version
--------------------------------------
-* Spring and Summer 2013: Lorenz Panny, Dmitriy Traytel, and Jasmin Blanchette, TUM
+* September 2013: Nik Sultana, University of Cambridge
+ Improvements to HOL/TPTP parser and import facilities.
+
+* Spring and Summer 2013: Lorenz Panny, Dmitriy Traytel, and
+ Jasmin Blanchette, TUM
Various improvements to BNF-based (co)datatype package, including a
"primrec_new" command and a compatibility layer.
diff -r d92578436d47 -r d2a7b6fe953e NEWS
--- a/NEWS Fri Sep 06 10:56:40 2013 +0200
+++ b/NEWS Fri Sep 06 10:57:27 2013 +0200
@@ -101,7 +101,7 @@
- Light-weight popup, which avoids explicit window (more reactive
and more robust). Interpreted key events include TAB, ESCAPE, UP,
- DOWN, PAGE_UP, PAGE_DOWN. Uninterpreted key events are passed to
+ DOWN, PAGE_UP, PAGE_DOWN. All other key events are passed to
the jEdit text area.
- Explicit completion via standard jEdit shortcut C+b, which has
diff -r d92578436d47 -r d2a7b6fe953e src/HOL/BNF/Tools/bnf_fp_rec_sugar.ML
--- a/src/HOL/BNF/Tools/bnf_fp_rec_sugar.ML Fri Sep 06 10:56:40 2013 +0200
+++ b/src/HOL/BNF/Tools/bnf_fp_rec_sugar.ML Fri Sep 06 10:57:27 2013 +0200
@@ -36,8 +36,7 @@
fun permute_args n t = list_comb (t, map Bound (0 :: (n downto 1)))
|> fold (K (fn u => Abs (Name.uu, dummyT, u))) (0 upto n);
-fun abs_tuple t = if t = undef_const then t else
- strip_abs t |>> HOLogic.mk_tuple o map Free |-> HOLogic.tupled_lambda;
+val abs_tuple = HOLogic.tupled_lambda o HOLogic.mk_tuple;
val simp_attrs = @{attributes [simp]};
@@ -107,7 +106,7 @@
user_eqn = eqn'}
end;
-fun rewrite_map_arg fun_name_ctr_pos_list rec_type res_type =
+fun rewrite_map_arg get_ctr_pos rec_type res_type =
let
val pT = HOLogic.mk_prodT (rec_type, res_type);
@@ -117,11 +116,9 @@
| subst d t =
let
val (u, vs) = strip_comb t;
- val maybe_fun_name_ctr_pos =
- find_first (equal (free_name u) o SOME o fst) fun_name_ctr_pos_list;
- val (fun_name, ctr_pos) = the_default ("", ~1) maybe_fun_name_ctr_pos;
+ val ctr_pos = try (get_ctr_pos o the) (free_name u) |> the_default ~1;
in
- if is_some maybe_fun_name_ctr_pos then
+ if ctr_pos >= 0 then
if d = SOME ~1 andalso length vs = ctr_pos then
list_comb (permute_args ctr_pos (snd_const pT), vs)
else if length vs > ctr_pos andalso is_some d
@@ -138,7 +135,7 @@
subst (SOME ~1)
end;
-fun subst_rec_calls lthy fun_name_ctr_pos_list has_call ctr_args direct_calls indirect_calls t =
+fun subst_rec_calls lthy get_ctr_pos has_call ctr_args direct_calls indirect_calls t =
let
fun subst bound_Ts (Abs (v, T, b)) = Abs (v, T, subst (T :: bound_Ts) b)
| subst bound_Ts (t as g' $ y) =
@@ -146,19 +143,18 @@
val maybe_direct_y' = AList.lookup (op =) direct_calls y;
val maybe_indirect_y' = AList.lookup (op =) indirect_calls y;
val (g, g_args) = strip_comb g';
- val maybe_ctr_pos =
- try (snd o the o find_first (equal (free_name g) o SOME o fst)) fun_name_ctr_pos_list;
- val _ = is_none maybe_ctr_pos orelse length g_args >= the maybe_ctr_pos orelse
+ val ctr_pos = try (get_ctr_pos o the) (free_name g) |> the_default ~1;
+ val _ = ctr_pos < 0 orelse length g_args >= ctr_pos orelse
primrec_error_eqn "too few arguments in recursive call" t;
in
if not (member (op =) ctr_args y) then
pairself (subst bound_Ts) (g', y) |> (op $)
- else if is_some maybe_ctr_pos then
+ else if ctr_pos >= 0 then
list_comb (the maybe_direct_y', g_args)
else if is_some maybe_indirect_y' then
(if has_call g' then t else y)
|> massage_indirect_rec_call lthy has_call
- (rewrite_map_arg fun_name_ctr_pos_list) bound_Ts y (the maybe_indirect_y')
+ (rewrite_map_arg get_ctr_pos) bound_Ts y (the maybe_indirect_y')
|> (if has_call g' then I else curry (op $) g')
else
t
@@ -211,16 +207,17 @@
nth_map arg_idx (K (nth ctr_args ctr_arg_idx |> map_types make_indirect_type)))
indirect_calls';
+ val fun_name_ctr_pos_list =
+ map (fn (x :: _) => (#fun_name x, length (#left_args x))) funs_data;
+ val get_ctr_pos = try (the o AList.lookup (op =) fun_name_ctr_pos_list) #> the_default ~1;
val direct_calls = map (apfst (nth ctr_args) o apsnd (nth args)) direct_calls';
val indirect_calls = map (apfst (nth ctr_args) o apsnd (nth args)) indirect_calls';
- val abstractions = map dest_Free (args @ #left_args eqn_data @ #right_args eqn_data);
- val fun_name_ctr_pos_list =
- map (fn (x :: _) => (#fun_name x, length (#left_args x))) funs_data;
+ val abstractions = args @ #left_args eqn_data @ #right_args eqn_data;
in
t
- |> subst_rec_calls lthy fun_name_ctr_pos_list has_call ctr_args direct_calls indirect_calls
- |> fold_rev absfree abstractions
+ |> subst_rec_calls lthy get_ctr_pos has_call ctr_args direct_calls indirect_calls
+ |> fold_rev lambda abstractions
end;
fun build_defs lthy bs mxs funs_data rec_specs has_call =
@@ -372,15 +369,16 @@
type co_eqn_data_disc = {
fun_name: string,
+ fun_args: term list,
ctr_no: int, (*###*)
cond: term,
user_eqn: term
};
type co_eqn_data_sel = {
fun_name: string,
+ fun_args: term list,
ctr: term,
sel: term,
- fun_args: term list,
rhs_term: term,
user_eqn: term
};
@@ -388,11 +386,10 @@
Disc of co_eqn_data_disc |
Sel of co_eqn_data_sel;
-fun co_dissect_eqn_disc sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds_ps =
+fun co_dissect_eqn_disc sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds =
let
fun find_subterm p = let (* FIXME \? *)
- fun f (t as u $ v) =
- fold_rev (curry merge_options) [if p t then SOME t else NONE, f u, f v] NONE
+ fun f (t as u $ v) = if p t then SOME t else merge_options (f u, f v)
| f t = if p t then SOME t else NONE
in f end;
@@ -406,9 +403,8 @@
val discs = #ctr_specs corec_spec |> map #disc;
val ctrs = #ctr_specs corec_spec |> map #ctr;
- val n_ctrs = length ctrs;
val not_disc = head_of imp_rhs = @{term Not};
- val _ = not_disc andalso n_ctrs <> 2 andalso
+ val _ = not_disc andalso length ctrs <> 2 andalso
primrec_error_eqn "\ed discriminator for a type with \ 2 constructors" imp_rhs;
val disc = find_subterm (member (op =) discs o head_of) imp_rhs;
val eq_ctr0 = imp_rhs |> perhaps (try (HOLogic.dest_not)) |> try (HOLogic.dest_eq #> snd)
@@ -428,32 +424,28 @@
val mk_conjs = try (foldr1 HOLogic.mk_conj) #> the_default @{const True};
val mk_disjs = try (foldr1 HOLogic.mk_disj) #> the_default @{const False};
val catch_all = try (fst o dest_Free o the_single) imp_lhs' = SOME Name.uu_;
- val matched_conds = filter (equal fun_name o fst) matched_conds_ps |> map snd;
- val imp_lhs = mk_conjs imp_lhs';
+ val matched_cond = filter (equal fun_name o fst) matched_conds |> map snd |> mk_disjs;
+ val imp_lhs = mk_conjs imp_lhs'
+ |> incr_boundvars (length fun_args)
+ |> subst_atomic (fun_args ~~ map Bound (length fun_args - 1 downto 0))
val cond =
if catch_all then
- if null matched_conds then fold_rev absfree (map dest_Free fun_args) @{const True} else
- (strip_abs_vars (hd matched_conds),
- mk_disjs (map strip_abs_body matched_conds) |> HOLogic.mk_not)
- |-> fold_rev (fn (v, T) => fn u => Abs (v, T, u))
+ matched_cond |> HOLogic.mk_not
else if sequential then
- HOLogic.mk_conj (HOLogic.mk_not (mk_disjs (map strip_abs_body matched_conds)), imp_lhs)
- |> fold_rev absfree (map dest_Free fun_args)
+ HOLogic.mk_conj (HOLogic.mk_not matched_cond, imp_lhs)
else
- imp_lhs |> fold_rev absfree (map dest_Free fun_args);
- val matched_cond =
- if sequential then fold_rev absfree (map dest_Free fun_args) imp_lhs else cond;
+ imp_lhs;
- val matched_conds_ps' = if catch_all
- then (fun_name, cond) :: filter (not_equal fun_name o fst) matched_conds_ps
- else (fun_name, matched_cond) :: matched_conds_ps;
+ val matched_conds' =
+ (fun_name, if catch_all orelse not sequential then cond else imp_lhs) :: matched_conds;
in
(Disc {
fun_name = fun_name,
+ fun_args = fun_args,
ctr_no = ctr_no,
cond = cond,
user_eqn = eqn'
- }, matched_conds_ps')
+ }, matched_conds')
end;
fun co_dissect_eqn_sel fun_name_corec_spec_list eqn' eqn =
@@ -473,15 +465,15 @@
in
Sel {
fun_name = fun_name,
+ fun_args = fun_args,
ctr = #ctr ctr_spec,
sel = sel,
- fun_args = fun_args,
rhs_term = rhs,
user_eqn = eqn'
}
end;
-fun co_dissect_eqn_ctr sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds_ps =
+fun co_dissect_eqn_ctr sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds =
let
val (lhs, rhs) = HOLogic.dest_eq imp_rhs;
val fun_name = head_of lhs |> fst o dest_Free;
@@ -491,10 +483,10 @@
handle Option.Option => primrec_error_eqn "not a constructor" ctr;
val disc_imp_rhs = betapply (#disc ctr_spec, lhs);
- val (maybe_eqn_data_disc, matched_conds_ps') = if length (#ctr_specs corec_spec) = 1
- then (NONE, matched_conds_ps)
+ val (maybe_eqn_data_disc, matched_conds') = if length (#ctr_specs corec_spec) = 1
+ then (NONE, matched_conds)
else apfst SOME (co_dissect_eqn_disc
- sequential fun_name_corec_spec_list eqn' imp_lhs' disc_imp_rhs matched_conds_ps);
+ sequential fun_name_corec_spec_list eqn' imp_lhs' disc_imp_rhs matched_conds);
val sel_imp_rhss = (#sels ctr_spec ~~ ctr_args)
|> map (fn (sel, ctr_arg) => HOLogic.mk_eq (betapply (sel, lhs), ctr_arg));
@@ -506,10 +498,10 @@
val eqns_data_sel =
map (co_dissect_eqn_sel fun_name_corec_spec_list eqn') sel_imp_rhss;
in
- (map_filter I [maybe_eqn_data_disc] @ eqns_data_sel, matched_conds_ps')
+ (map_filter I [maybe_eqn_data_disc] @ eqns_data_sel, matched_conds')
end;
-fun co_dissect_eqn sequential fun_name_corec_spec_list eqn' matched_conds_ps =
+fun co_dissect_eqn sequential fun_name_corec_spec_list eqn' matched_conds =
let
val eqn = subst_bounds (strip_qnt_vars @{const_name all} eqn' |> map Free |> rev,
strip_qnt_body @{const_name all} eqn')
@@ -531,79 +523,112 @@
if member (op =) discs head orelse
is_some maybe_rhs andalso
member (op =) (filter (null o binder_types o fastype_of) ctrs) (the maybe_rhs) then
- co_dissect_eqn_disc sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds_ps
+ co_dissect_eqn_disc sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds
|>> single
else if member (op =) sels head then
- ([co_dissect_eqn_sel fun_name_corec_spec_list eqn' imp_rhs], matched_conds_ps)
+ ([co_dissect_eqn_sel fun_name_corec_spec_list eqn' imp_rhs], matched_conds)
else if is_Free head andalso member (op =) fun_names (fst (dest_Free head)) then
- co_dissect_eqn_ctr sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds_ps
+ co_dissect_eqn_ctr sequential fun_name_corec_spec_list eqn' imp_lhs' imp_rhs matched_conds
else
primrec_error_eqn "malformed function equation" eqn
end;
fun build_corec_args_discs disc_eqns ctr_specs =
- let
- val conds = map #cond disc_eqns;
- val args' =
- if length ctr_specs = 1 then []
- else if length disc_eqns = length ctr_specs then
- fst (split_last conds)
- else if length disc_eqns = length ctr_specs - 1 then
- let val n = 0 upto length ctr_specs - 1
- |> the o find_first (fn idx => not (exists (equal idx o #ctr_no) disc_eqns)) (*###*) in
- if n = length ctr_specs - 1 then
- conds
- else
- split_last conds
- ||> (fn t => fold_rev absfree (strip_abs_vars t) (strip_abs_body t |> HOLogic.mk_not))
- |>> chop n
- |> (fn ((l, r), x) => l @ (x :: r))
- end
- else
- 0 upto length ctr_specs - 1
- |> map (fn idx => find_first (equal idx o #ctr_no) disc_eqns
- |> Option.map #cond
- |> the_default undef_const)
- |> fst o split_last;
- in
- (* FIXME: deal with #preds above *)
- fold2 (fn idx => nth_map idx o K o abs_tuple) (map_filter #pred ctr_specs) args'
- end;
+ if null disc_eqns then I else
+ let
+(*val _ = tracing ("d/p:\ " ^ space_implode "\n \ " (map ((op ^) o
+ apfst (Syntax.string_of_term @{context}) o apsnd (curry (op ^) " / " o @{make_string}))
+ (ctr_specs |> map_filter (fn {disc, pred = SOME pred, ...} => SOME (disc, pred) | _ => NONE))));*)
+ val conds = map #cond disc_eqns;
+ val fun_args = #fun_args (hd disc_eqns);
+ val args =
+ if length ctr_specs = 1 then []
+ else if length disc_eqns = length ctr_specs then
+ fst (split_last conds)
+ else if length disc_eqns = length ctr_specs - 1 then
+ let val n = 0 upto length ctr_specs - 1
+ |> the(*###*) o find_first (fn idx => not (exists (equal idx o #ctr_no) disc_eqns)) in
+ if n = length ctr_specs - 1 then
+ conds
+ else
+ split_last conds
+ ||> HOLogic.mk_not
+ |> `(uncurry (fold (curry HOLogic.mk_conj o HOLogic.mk_not)))
+ ||> chop n o fst
+ |> (fn (x, (l, r)) => l @ (x :: r))
+ end
+ else
+ 0 upto length ctr_specs - 1
+ |> map (fn idx => find_first (equal idx o #ctr_no) disc_eqns
+ |> Option.map #cond
+ |> the_default undef_const)
+ |> fst o split_last;
+ in
+ (* FIXME deal with #preds above *)
+ (map_filter #pred ctr_specs, args)
+ |-> fold2 (fn idx => fn t => nth_map idx
+ (K (subst_bounds (List.rev fun_args, t)
+ |> HOLogic.tupled_lambda (HOLogic.mk_tuple fun_args))))
+ end;
fun build_corec_arg_no_call sel_eqns sel = find_first (equal sel o #sel) sel_eqns
- |> try (fn SOME sel_eqn => (#fun_args sel_eqn |> map dest_Free, #rhs_term sel_eqn))
+ |> try (fn SOME sel_eqn => (#fun_args sel_eqn, #rhs_term sel_eqn))
|> the_default ([], undef_const)
- |-> abs_tuple oo fold_rev absfree;
+ |-> abs_tuple
+ |> K;
fun build_corec_arg_direct_call lthy has_call sel_eqns sel =
let
- val maybe_sel_eqn = find_first (equal sel o #sel) sel_eqns
-
- fun rewrite U T t =
+ val maybe_sel_eqn = find_first (equal sel o #sel) sel_eqns;
+ fun rewrite is_end U T t =
if U = @{typ bool} then @{term True} |> has_call t ? K @{term False} (* stop? *)
- else if T = U = has_call t then undef_const
- else if T = U then t (* end *)
+ else if is_end = has_call t then undef_const
+ else if is_end then t (* end *)
else HOLogic.mk_tuple (snd (strip_comb t)); (* continue *)
- fun massage rhs_term t =
- massage_direct_corec_call lthy has_call rewrite [] (body_type (fastype_of t)) rhs_term;
- val abstract = abs_tuple oo fold_rev absfree o map dest_Free;
+ fun massage rhs_term is_end t = massage_direct_corec_call
+ lthy has_call (rewrite is_end) [] (range_type (fastype_of t)) rhs_term;
+ in
+ if is_none maybe_sel_eqn then K I else
+ abs_tuple (#fun_args (the maybe_sel_eqn)) oo massage (#rhs_term (the maybe_sel_eqn))
+ end;
+
+fun build_corec_arg_indirect_call lthy has_call sel_eqns sel =
+ let
+ val maybe_sel_eqn = find_first (equal sel o #sel) sel_eqns;
+ fun rewrite _ _ =
+ let
+ fun subst (Abs (v, T, b)) = Abs (v, T, subst b)
+ | subst (t as _ $ _) =
+ let val (u, vs) = strip_comb t in
+ if is_Free u andalso has_call u then
+ Const (@{const_name Inr}, dummyT) $ (*HOLogic.mk_tuple vs*)
+ (try (foldr1 (fn (x, y) => Const (@{const_name Pair}, dummyT) $ x $ y)) vs
+ |> the_default (hd vs))
+ else if try (fst o dest_Const) u = SOME @{const_name prod_case} then
+ list_comb (u |> map_types (K dummyT), map subst vs)
+ else
+ list_comb (subst u, map subst vs)
+ end
+ | subst t = t;
+ in
+ subst
+ end;
+ fun massage rhs_term t = massage_indirect_corec_call
+ lthy has_call rewrite [] (fastype_of t |> range_type) rhs_term;
in
if is_none maybe_sel_eqn then I else
- massage (#rhs_term (the maybe_sel_eqn)) #> abstract (#fun_args (the maybe_sel_eqn))
+ abs_tuple (#fun_args (the maybe_sel_eqn)) o massage (#rhs_term (the maybe_sel_eqn))
end;
-fun build_corec_arg_indirect_call sel_eqns sel =
- primrec_error "indirect corecursion not implemented yet";
-
fun build_corec_args_sel lthy has_call all_sel_eqns ctr_spec =
let val sel_eqns = filter (equal (#ctr ctr_spec) o #ctr) all_sel_eqns in
if null sel_eqns then I else
let
val sel_call_list = #sels ctr_spec ~~ #calls ctr_spec;
-val _ = tracing ("sels / calls:\n \ " ^ space_implode "\n \ " (map ((op ^) o
- apfst (Syntax.string_of_term @{context}) o apsnd (curry (op ^) " / " o @{make_string}))
- (sel_call_list)));
+(*val _ = tracing ("s/c:\ " ^ space_implode "\n \ " (map ((op ^) o
+ apfst (Syntax.string_of_term lthy) o apsnd (curry (op ^) " / " o @{make_string}))
+ sel_call_list));*)
val no_calls' = map_filter (try (apsnd (fn No_Corec n => n))) sel_call_list;
val direct_calls' = map_filter (try (apsnd (fn Direct_Corec n => n))) sel_call_list;
@@ -611,12 +636,12 @@
in
I
#> fold (fn (sel, n) => nth_map n
- (build_corec_arg_no_call sel_eqns sel |> K)) no_calls'
+ (build_corec_arg_no_call sel_eqns sel)) no_calls'
#> fold (fn (sel, (q, g, h)) =>
let val f = build_corec_arg_direct_call lthy has_call sel_eqns sel in
- nth_map h f o nth_map g f o nth_map q f end) direct_calls'
+ nth_map h (f false) o nth_map g (f true) o nth_map q (f true) end) direct_calls'
#> fold (fn (sel, n) => nth_map n
- (build_corec_arg_indirect_call sel_eqns sel |> K)) indirect_calls'
+ (build_corec_arg_indirect_call lthy has_call sel_eqns sel)) indirect_calls'
end
end;
@@ -651,24 +676,26 @@
|> fold2 build_corec_args_discs disc_eqnss ctr_specss
|> fold2 (fold o build_corec_args_sel lthy has_call) sel_eqnss ctr_specss;
+ fun currys Ts t = if length Ts <= 1 then t else
+ t $ foldr1 (fn (u, v) => HOLogic.pair_const dummyT dummyT $ u $ v)
+ (length Ts - 1 downto 0 |> map Bound)
+ |> fold_rev (fn T => fn u => Abs (Name.uu, T, u)) Ts;
+
val _ = tracing ("corecursor arguments:\n \ " ^
- space_implode "\n \ " (map (Syntax.string_of_term @{context}) corec_args));
+ space_implode "\n \ " (map (Syntax.string_of_term lthy) corec_args));
fun uneq_pairs_rev xs = xs (* FIXME \? *)
|> these o try (split_last #> (fn (ys, y) => uneq_pairs_rev ys @ map (pair y) ys));
val proof_obligations = if sequential then [] else
- maps (uneq_pairs_rev o map #cond) disc_eqnss
- |> map (fn (x, y) => ((strip_abs_body x, strip_abs_body y), strip_abs_vars x))
- |> map (apfst (apsnd HOLogic.mk_not #> pairself HOLogic.mk_Trueprop
- #> apfst (curry (op $) @{const ==>}) #> (op $)))
- |> map (fn (t, abs_vars) => fold_rev (fn (v, T) => fn u =>
- Const (@{const_name all}, (T --> @{typ prop}) --> @{typ prop}) $
- Abs (v, T, u)) abs_vars t);
+ disc_eqnss
+ |> maps (uneq_pairs_rev o map (fn {fun_args, cond, ...} => (fun_args, cond)))
+ |> map (fn ((fun_args, x), (_, y)) => [x, HOLogic.mk_not y]
+ |> map (HOLogic.mk_Trueprop o curry subst_bounds (List.rev fun_args))
+ |> curry list_comb @{const ==>});
- fun currys Ts t = if length Ts <= 1 then t else
- t $ foldr1 (fn (u, v) => HOLogic.pair_const dummyT dummyT $ u $ v)
- (length Ts - 1 downto 0 |> map Bound)
- |> fold_rev (fn T => fn u => Abs (Name.uu, T, u)) Ts;
+val _ = tracing ("proof obligations:\n \ " ^
+ space_implode "\n \ " (map (Syntax.string_of_term lthy) proof_obligations));
+
in
map (list_comb o rpair corec_args) corecs
|> map2 (fn Ts => fn t => if length Ts = 0 then t $ HOLogic.unit else t) arg_Tss
diff -r d92578436d47 -r d2a7b6fe953e src/HOL/BNF/Tools/bnf_fp_rec_sugar_util.ML
--- a/src/HOL/BNF/Tools/bnf_fp_rec_sugar_util.ML Fri Sep 06 10:56:40 2013 +0200
+++ b/src/HOL/BNF/Tools/bnf_fp_rec_sugar_util.ML Fri Sep 06 10:57:27 2013 +0200
@@ -198,11 +198,11 @@
fun massage_indirect_corec_call ctxt has_call massage_direct_call bound_Ts res_U t =
let
val typof = curry fastype_of1 bound_Ts;
- val build_map_Inl = build_map ctxt (uncurry Inl_const o dest_sumT o fst);
+ val build_map_Inl = build_map ctxt (uncurry Inl_const o dest_sumT o snd)
fun check_and_massage_direct_call U T t =
if has_call t then factor_out_types ctxt massage_direct_call dest_sumT U T t
- else build_map_Inl (U, T) $ t;
+ else build_map_Inl (T, U) $ t;
fun check_and_massage_unapplied_direct_call U T t =
let val var = Var ((Name.uu, Term.maxidx_of_term t + 1), domain_type (typof t)) in
@@ -241,11 +241,11 @@
| NONE =>
(case t of
t1 $ t2 =>
- if has_call t2 then
+ (if has_call t2 then
check_and_massage_direct_call U T t
else
massage_map U T t1 $ t2
- handle AINT_NO_MAP _ => check_and_massage_direct_call U T t
+ handle AINT_NO_MAP _ => check_and_massage_direct_call U T t)
| _ => check_and_massage_direct_call U T t))
| _ => ill_formed_corec_call ctxt t))
U T
diff -r d92578436d47 -r d2a7b6fe953e src/HOL/List.thy
--- a/src/HOL/List.thy Fri Sep 06 10:56:40 2013 +0200
+++ b/src/HOL/List.thy Fri Sep 06 10:57:27 2013 +0200
@@ -548,9 +548,9 @@
fun check (i, case_t) s =
(case strip_abs_body case_t of
(Const (@{const_name List.Nil}, _)) => s
- | _ => (case s of NONE => SOME i | SOME _ => NONE))
+ | _ => (case s of SOME NONE => SOME (SOME i) | _ => NONE))
in
- fold_index check cases NONE
+ fold_index check cases (SOME NONE) |> the_default NONE
end
(* returns (case_expr type index chosen_case) option *)
fun dest_case case_term =
diff -r d92578436d47 -r d2a7b6fe953e src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy
--- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Fri Sep 06 10:56:40 2013 +0200
+++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Fri Sep 06 10:57:27 2013 +0200
@@ -34,8 +34,8 @@
using assms convex_def[of S] by auto
lemma mem_convex_alt:
- assumes "convex S" "x : S" "y : S" "u>=0" "v>=0" "u+v>0"
- shows "((u/(u+v)) *\<^sub>R x + (v/(u+v)) *\<^sub>R y) : S"
+ assumes "convex S" "x \ S" "y \ S" "u \ 0" "v \ 0" "u + v > 0"
+ shows "((u/(u+v)) *\<^sub>R x + (v/(u+v)) *\<^sub>R y) \ S"
apply (subst mem_convex_2)
using assms
apply (auto simp add: algebra_simps zero_le_divide_iff)
@@ -74,20 +74,20 @@
fixes f :: "'n::euclidean_space \ 'm::euclidean_space"
assumes lf: "linear f"
and fi: "inj_on f (span S)"
- shows "dim (f ` S) = dim (S:: 'n::euclidean_space set)"
-proof -
- obtain B where B_def: "B \ S \ independent B \ S \ span B \ card B = dim S"
+ shows "dim (f ` S) = dim (S::'n::euclidean_space set)"
+proof -
+ obtain B where B: "B \ S" "independent B" "S \ span B" "card B = dim S"
using basis_exists[of S] by auto
then have "span S = span B"
using span_mono[of B S] span_mono[of S "span B"] span_span[of B] by auto
then have "independent (f ` B)"
- using independent_injective_on_span_image[of B f] B_def assms by auto
+ using independent_injective_on_span_image[of B f] B assms by auto
moreover have "card (f ` B) = card B"
- using assms card_image[of f B] subset_inj_on[of f "span S" B] B_def span_inc by auto
+ using assms card_image[of f B] subset_inj_on[of f "span S" B] B span_inc by auto
moreover have "(f ` B) \ (f ` S)"
- using B_def by auto
+ using B by auto
ultimately have "dim (f ` S) \ dim S"
- using independent_card_le_dim[of "f ` B" "f ` S"] B_def by auto
+ using independent_card_le_dim[of "f ` B" "f ` S"] B by auto
then show ?thesis
using dim_image_le[of f S] assms by auto
qed
@@ -220,8 +220,6 @@
and C: "C \ T" "independent C" "T \ span C" "card C = dim T"
shows "\f. linear f \ f ` B = C \ f ` S = T \ inj_on f S"
proof -
-(* Proof is a modified copy of the proof of similar lemma subspace_isomorphism
-*)
from B independent_bound have fB: "finite B"
by blast
from C independent_bound have fC: "finite C"
@@ -293,9 +291,6 @@
then show ?thesis using closure_linear_image[of f S] assms by auto
qed
-lemma closure_direct_sum: "closure (S \ T) = closure S \ closure T"
- by (rule closure_Times)
-
lemma closure_scaleR:
fixes S :: "'a::real_normed_vector set"
shows "(op *\<^sub>R c) ` (closure S) = closure ((op *\<^sub>R c) ` S)"
@@ -367,7 +362,7 @@
by (auto simp add:norm_minus_commute)
qed
-lemma norm_minus_eqI:"x = - y \ norm x = norm y" by auto
+lemma norm_minus_eqI: "x = - y \ norm x = norm y" by auto
lemma Min_grI:
assumes "finite A" "A \ {}" "\a\A. x < a"
@@ -8668,7 +8663,7 @@
have "(closure S) + (closure T) = (\(x,y). x + y) ` (closure S \ closure T)"
by (simp add: set_plus_image)
also have "... = (\(x,y). x + y) ` closure (S \ T)"
- using closure_direct_sum by auto
+ using closure_Times by auto
also have "... \ closure (S + T)"
using fst_snd_linear closure_linear_image[of "(\(x,y). x + y)" "S \ T"]
by (auto simp: set_plus_image)
diff -r d92578436d47 -r d2a7b6fe953e src/HOL/Multivariate_Analysis/Integration.thy
--- a/src/HOL/Multivariate_Analysis/Integration.thy Fri Sep 06 10:56:40 2013 +0200
+++ b/src/HOL/Multivariate_Analysis/Integration.thy Fri Sep 06 10:57:27 2013 +0200
@@ -1,6 +1,8 @@
+(* Author: John Harrison
+ Author: Robert Himmelmann, TU Muenchen (Translation from HOL light)
+*)
+
header {* Kurzweil-Henstock Gauge Integration in many dimensions. *}
-(* Author: John Harrison
- Translation from HOL light: Robert Himmelmann, TU Muenchen *)
theory Integration
imports
@@ -11,62 +13,76 @@
lemma cSup_abs_le: (* TODO: is this really needed? *)
fixes S :: "real set"
shows "S \ {} \ (\x\S. \x\ \ a) \ \Sup S\ \ a"
-by (auto simp add: abs_le_interval_iff intro: cSup_least) (metis cSup_upper2)
+ by (auto simp add: abs_le_interval_iff intro: cSup_least) (metis cSup_upper2)
lemma cInf_abs_ge: (* TODO: is this really needed? *)
fixes S :: "real set"
shows "S \ {} \ (\x\S. \x\ \ a) \ \Inf S\ \ a"
-by (simp add: Inf_real_def) (rule cSup_abs_le, auto)
+ by (simp add: Inf_real_def) (rule cSup_abs_le, auto)
lemma cSup_asclose: (* TODO: is this really needed? *)
fixes S :: "real set"
- assumes S:"S \ {}" and b: "\x\S. \x - l\ \ e" shows "\Sup S - l\ \ e"
-proof-
- have th: "\(x::real) l e. \x - l\ \ e \ l - e \ x \ x \ l + e" by arith
- thus ?thesis using S b cSup_bounds[of S "l - e" "l+e"] unfolding th
- by (auto simp add: setge_def setle_def)
+ assumes S: "S \ {}"
+ and b: "\x\S. \x - l\ \ e"
+ shows "\Sup S - l\ \ e"
+proof -
+ have th: "\(x::real) l e. \x - l\ \ e \ l - e \ x \ x \ l + e"
+ by arith
+ then show ?thesis
+ using S b cSup_bounds[of S "l - e" "l+e"]
+ unfolding th
+ by (auto simp add: setge_def setle_def)
qed
lemma cInf_asclose: (* TODO: is this really needed? *)
fixes S :: "real set"
- assumes S:"S \ {}" and b: "\x\S. \x - l\ \ e" shows "\Inf S - l\ \ e"
+ assumes S: "S \ {}"
+ and b: "\x\S. \x - l\ \ e"
+ shows "\Inf S - l\ \ e"
proof -
have "\- Sup (uminus ` S) - l\ = \Sup (uminus ` S) - (-l)\"
by auto
- also have "... \ e"
- apply (rule cSup_asclose)
+ also have "\ \ e"
+ apply (rule cSup_asclose)
apply (auto simp add: S)
apply (metis abs_minus_add_cancel b add_commute diff_minus)
done
finally have "\- Sup (uminus ` S) - l\ \ e" .
- thus ?thesis
+ then show ?thesis
by (simp add: Inf_real_def)
qed
-lemma cSup_finite_ge_iff:
- fixes S :: "real set" shows "finite S \ S \ {} \ a \ Sup S \ (\x\S. a \ x)"
+lemma cSup_finite_ge_iff:
+ fixes S :: "real set"
+ shows "finite S \ S \ {} \ a \ Sup S \ (\x\S. a \ x)"
by (metis cSup_eq_Max Max_ge_iff)
-lemma cSup_finite_le_iff:
- fixes S :: "real set" shows "finite S \ S \ {} \ a \ Sup S \ (\x\S. a \ x)"
+lemma cSup_finite_le_iff:
+ fixes S :: "real set"
+ shows "finite S \ S \ {} \ a \ Sup S \ (\x\S. a \ x)"
by (metis cSup_eq_Max Max_le_iff)
-lemma cInf_finite_ge_iff:
- fixes S :: "real set" shows "finite S \ S \ {} \ a \ Inf S \ (\x\S. a \ x)"
+lemma cInf_finite_ge_iff:
+ fixes S :: "real set"
+ shows "finite S \ S \ {} \ a \ Inf S \ (\x\S. a \ x)"
by (metis cInf_eq_Min Min_ge_iff)
-lemma cInf_finite_le_iff:
- fixes S :: "real set" shows "finite S \ S \ {} \ a \ Inf S \ (\x\S. a \ x)"
+lemma cInf_finite_le_iff:
+ fixes S :: "real set"
+ shows "finite S \ S \ {} \ a \ Inf S \ (\x\S. a \ x)"
by (metis cInf_eq_Min Min_le_iff)
lemma Inf: (* rename *)
fixes S :: "real set"
- shows "S \ {} ==> (\b. b <=* S) ==> isGlb UNIV S (Inf S)"
-by (auto simp add: isLb_def setle_def setge_def isGlb_def greatestP_def intro: cInf_lower cInf_greatest)
-
+ shows "S \ {} \ (\b. b <=* S) \ isGlb UNIV S (Inf S)"
+ by (auto simp add: isLb_def setle_def setge_def isGlb_def greatestP_def
+ intro: cInf_lower cInf_greatest)
+
lemma real_le_inf_subset:
- assumes "t \ {}" "t \ s" "\b. b <=* s"
- shows "Inf s <= Inf (t::real set)"
+ assumes "t \ {}"
+ and "t \ s"
+ and "\b. b <=* s"
+ shows "Inf s \ Inf (t::real set)"
apply (rule isGlb_le_isLb)
apply (rule Inf[OF assms(1)])
apply (insert assms)
@@ -76,8 +92,11 @@
done
lemma real_ge_sup_subset:
- assumes "t \ {}" "t \ s" "\b. s *<= b"
- shows "Sup s >= Sup (t::real set)"
+ fixes t :: "real set"
+ assumes "t \ {}"
+ and "t \ s"
+ and "\b. s *<= b"
+ shows "Sup s \ Sup t"
apply (rule isLub_le_isUb)
apply (rule isLub_cSup[OF assms(1)])
apply (insert assms)
@@ -104,9 +123,10 @@
lemma conjunctD4: assumes "a \ b \ c \ d" shows a b c d using assms by auto
lemma conjunctD5: assumes "a \ b \ c \ d \ e" shows a b c d e using assms by auto
-declare norm_triangle_ineq4[intro]
-
-lemma simple_image: "{f x |x . x \ s} = f ` s" by blast
+declare norm_triangle_ineq4[intro]
+
+lemma simple_image: "{f x |x . x \ s} = f ` s"
+ by blast
lemma linear_simps:
assumes "bounded_linear f"
@@ -123,24 +143,30 @@
lemma bounded_linearI:
assumes "\x y. f (x + y) = f x + f y"
- and "\r x. f (r *\<^sub>R x) = r *\<^sub>R f x" "\x. norm (f x) \ norm x * K"
+ and "\r x. f (r *\<^sub>R x) = r *\<^sub>R f x"
+ and "\x. norm (f x) \ norm x * K"
shows "bounded_linear f"
- unfolding bounded_linear_def additive_def bounded_linear_axioms_def using assms by auto
+ unfolding bounded_linear_def additive_def bounded_linear_axioms_def
+ using assms by auto
lemma bounded_linear_component [intro]: "bounded_linear (\x::'a::euclidean_space. x \ k)"
by (rule bounded_linear_inner_left)
lemma transitive_stepwise_lt_eq:
assumes "(\x y z::nat. R x y \ R y z \ R x z)"
- shows "((\m. \n>m. R m n) \ (\n. R n (Suc n)))" (is "?l = ?r")
-proof (safe)
+ shows "((\m. \n>m. R m n) \ (\n. R n (Suc n)))"
+ (is "?l = ?r")
+proof safe
assume ?r
fix n m :: nat
assume "m < n"
then show "R m n"
proof (induct n arbitrary: m)
+ case 0
+ then show ?case by auto
+ next
case (Suc n)
- show ?case
+ show ?case
proof (cases "m < n")
case True
show ?thesis
@@ -150,14 +176,16 @@
done
next
case False
- then have "m = n" using Suc(2) by auto
- then show ?thesis using `?r` by auto
+ then have "m = n"
+ using Suc(2) by auto
+ then show ?thesis
+ using `?r` by auto
qed
- qed auto
+ qed
qed auto
lemma transitive_stepwise_gt:
- assumes "\x y z. R x y \ R y z \ R x z" "\n. R n (Suc n) "
+ assumes "\x y z. R x y \ R y z \