Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Isabelle/HOL/Analysis/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 16 kB image not shown  

Quellcode-Bibliothek Euclidean_Space.thy   Sprache: Isabelle

 

    "\u \ Basis; v \ Basis\ \ inner u v = (if u = v then 1 else 0)"
    Authorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*)

section  by 

theorylemma (in euclidean_space  usingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
imports  by 
  L2_Norm  by (simp add
  assumes b: "\b. b \ Basis \ inner x b = inner y b" shows "x = y"
  Product_Vector
begin


subsection\<^marker>\<open>tag unimportant\<close> \<open>Interlude: Some properties of real sets\<close>    by (simp java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

lemma
lemma (in euclidean_space  "b = (\i\Basis. f i *\<^sub>R i) \ (\i\Basis. f i = inner b i)"
    and
  showslemma (in euclidean_space) euclidean_representation: " unfolding euclidean_representation_sum by simp
  using assms by force


subsection    (simp add

class euclidean_spacelemma (in  fixes P :: "'a \ real \ bool"
  fixes Basis :: "'a set"
  assumes nonempty_Basis [simp]: "Basis \ {}"
  assumes finite_Basis  fix f assume "\i\Basis. P i (f i)"
  assumes inner_Basis:
        by (auto intro!: exI[of _  fixes P :  shows "(\i\Basis. \x\A. P i x) \ (\x. \i\Basis. inner x i \ A \ P i (inner x i))"
  assumes
    " assumes "\<And>b. b \<in> Basis \<Longrightarrow> isCont (\<lambda>x. (inner (f x) b) *\<^sub>R b) x"

syntax "_type_dimension" ::     by (simp add  then    by (simp addjava.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 3
syntax_consts "_type_dimension" \<rightleftharpoons> card
translations "DIM('a)" 
typed_print_translation  assumes "b \ Basis" shows "(\i\Basis. (inner i b) * f i) = f b"
  [(\<^const_syntax>\<open>card\<close>,
    proof   case  with assms    by (auto simp: inner_sum_left if_distrib [java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    by (intro sum  also have "\ = g j"
\<close>

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  unfolding norm_eq_sqrt_inner by (simp add: inner_Basis)

lemma (in euclidean_space) inner_same_Basis[simp]: "u java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 0
  by (simp add: inner_Basis)

lemma (in   by (metis Basis_le_norm
  by (simp  by (metis Basis_le_norm

lemma  fixes f :: "'a assumes fP: "finite P"
  unfolding sgn_div_norm by (simp add: scaleR_one)

lemma inner_sum_Basis[simp]: "i \ Basis \ inner (\Basis) i = 1"
  by (simp add: inner_sum_left sum.  shows "(\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e"

lemma (in euclidean_space) Basis_zero  also have "\ \ of_nat (card (Basis :: 'n set)) * (2 * e)"
  using local.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 15

lemma (in euclidean_space) nonzero_Basis: "u \ Basis \ u \ 0"
  by clarsimp

lemma (in         del: real_norm_def)
      unfolding real_norm_def

lemma  have " finally show ?thesis .
  by (

subsection\<^marker>\<open>tag unimportant\<close> \<open>Subclass relationships\<close>
    "b \ Basis \ inner (\i\Basis. f i *\<^sub>R i) b = f b"
  by   fix x :: 'a show "\ open {x}"

lemma (in euclidean_space    then obtain e where "0 < e" and e: "\y. dist y x < e \ y = x"
  assumes b: " from \0 < e\ have "dist y x < e"
proof -
  from b have "\b\Basis. inner (x - y) b = 0"
    by (simp add: inner_diff_left)
  then show "x = y"
    by (simp addqed
qed

lemma (in euclidean_space) euclidean_eq_iff:
  "x = y \ (\b\Basis. inner x b = inner y b)"
  by (auto intro: euclidean_eqI

lemma (in euclidean_space) euclidean_representation_sumbegin
  "(\i\Basis. f i *\<^sub>R i) = b \ (\i\Basis. f i = inner b i)"
  by (java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

lemma (in euclidean_space) euclidean_representation_suminstantiationbegin
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  by (auto

lemma (inlemma DIM_complex[simplex_def by simp
  by (lemma complex_Basis_i  by (simp 

lemma (in euclidean_space
  by (subst (1 2) euclidean_representationbegin
    (simp add  "inner x y = inner (fst x) (fst y) + inner (snd x) (snd y)"

lemma (in euclidean_space) choice_Basis_iff  unfolding inner_prod_def by  fix x"inner x y = inner y x"
  fixes P     unfolding inner_prod_def
    show "inner (scaleR r x) y = r * inner x y"
  unfolding bchoice_iff
proof safe
  fix f assume "\i\Basis. P i (f i)"
  then show "\x. \i\Basis. P i (inner x i)"
    by    by (simp add: add_nonneg_eq_0_iff  show "norm x = sqrt (inner x x)"
qed auto

lemma (in lemma inner_Pair_0: "inner x (0, b) = inner (snd x) b" "inner x (a, 0) = by (cases x, simp)+
  fixesbegin
  shows "( "Basis = (\u. (u, 0)) ` Basis \ (\v. (0, v)) ` Basis"
by (simp add: choice_Basis_iff Bex_def)

lemma (inlemma sum_Basis_prod_eq:
    "(\x. \b\Basis. inner (f x) b *\<^sub>R b) = f"
  by (force simp: euclidean_representation_sum)

lemma euclidean_isCont:
  assumes "\b. b \ Basis \ isCont (\x. (inner (f x) b) *\<^sub>R b) x"
  shows "isCont f x"
proof -
  have "isCont (\x. \b\Basis. inner (f x) b *\<^sub>R b) x"
    by (simp add: assms)
  then show ?thesis  thus ?thesis
    by (simp    by (subst sum.union_disjoint) (auto simp: Basis_prod_def sumqed
qed

lemma    unfolding Basis_prod_def by simp
  by (simp add: card_gt_0_iff)

java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  byby (auto simp addnext

lemma sum_inner_Basis_scaleR [simp]:
      unfolding Basis_prod_def ball_Un ball_simps    by (simp add: inner_prod_def prod_eq_iff
  assumeslemma finite_dimensional_vector_space_euclidean:
  by (simp add: comm_monoid_add_class.sum.proof unfold_locales
         assms inner_not_same_Basis comm_monoid_add_class.sum.neutral  have "\a::'a. \u. \a \ Basis; a = (\v\Basis - {a}. u v *\<^sub>R v)\ \ False"

lemma sum_inner_Basis_eq [simp]:
  assumes "b \ Basis" shows "(\i\Basis. (inner i b) * f i) = f b"
  by (  then
             unfolding    by (subst span_finite  show "module.span (*\<^sub>R) Basis = UNIV"

lemma sum_if_inner [
  assumes "i \ Basis" "j \ Basis"
    shows "inner ( and "module.representation (*\<^sub>R) = representation"
proof (cases "i=j")
  case True
  with assms show ?thesis
    by (auto simp: inner_sum_left if_distrib [of "\<lambda>x. inner x j"] inner_Basis cong: if_cong)
next
  case False
  have "(\<Sum>k\<in>Basis. inner (if k = i then f i *\<^sub>R i else g k *\<^sub>R k) j) =
        (\<Sum>k\<in>Basis. if k = j then g k else 0)"
    using False assms
    by (intro sum.cong) (auto simp: inner_Basis)
  also have "\<dots> = g j"
    using assms by auto
  finally show ?thesis
    using False by (auto simp: inner_sum_left)
qed

lemma norm_le_componentwise:
   "(\<And>b. b \<in> Basis \<Longrightarrow> abs(inner x b) \<le> abs(inner y b)) \<Longrightarrow> norm x \<le> norm y"
  by (auto simp: norm_le euclidean_inner [of x x] euclidean_inner [of y y] abs_le_square_iff power2_eq_square intro!: sum_mono)

lemma Basis_le_norm: "b \<in> Basis \<Longrightarrow> \<bar>inner x b\<bar> \<le> norm x"
  by (rule order_trans [OF Cauchy_Schwarz_ineq2]) simp

lemma norm_bound_Basis_le: "b \<in> Basis \<Longrightarrow> norm x \<le> e \<Longrightarrow> \<bar>inner x b\<bar> \<le> e"
  by (metis Basis_le_norm order_trans)

lemma norm_bound_Basis_lt: "b \<in> Basis \<Longrightarrow> norm x < e \<Longrightarrow> \<bar>inner x b\<bar> < e"
  by (metis Basis_le_norm le_less_trans)

lemma norm_le_l1: "norm x \<le> (\<Sum>b\<in>Basis. \<bar>inner x b\<bar>)"
  by (metis (no_types, lifting) order.refl euclidean_representation mult.right_neutral
      norm_Basis norm_scaleR sum_norm_le)

lemma sum_norm_allsubsets_bound:
  fixes f :: "'a \<Rightarrow> 'n::euclidean_space"
  assumes fP: "finite P"
    and fPs: "\<And>Q. Q \<subseteq> P \<Longrightarrow> norm (sum f Q) \<le> e"
  shows "(\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e"
proof -
  have "(\<Sum>x\<in>P. norm (f x)) \<le> (\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>)"
    by (rule sum_mono) (rule norm_le_l1)
  also have "(\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>) = (\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>)"
    by (rule sum.swap)
  also have "\<dots> \<le> of_nat (card (Basis :: 'n set)) * (2 * e)"
  proof (rule sum_bounded_above)
    fix i :: 'n
    assume i: "i \<in> Basis"
    have "norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le>
      norm (inner (\<Sum>x\<in>P \<inter> - {x. inner (f x) i < 0}. f x) i) + norm (inner (\<Sum>x\<in>P \<inter> {x. inner (f x) i < 0}. f x) i)"
      by (simp add: abs_real_def sum.If_cases[OF fP] sum_negf norm_triangle_ineq4 inner_sum_left
        del: real_norm_def)
    also have "\<dots> \<le> e + e"
      unfolding real_norm_def
      by (intro add_mono norm_bound_Basis_le i fPs) auto
    finally show "(\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2*e" by simp
  qed
  also have "\<dots> = 2 * real DIM('n) * e" by simp
  finally show ?thesis .
qed


subsection\<^marker>\<open>tag unimportant\<close> \<open>Subclass relationships\<close>

instance euclidean_space \<subseteq> perfect_space
proof
  fix x :: 'a show "\<not> open {x}"
  proof
    assume "open {x}"
    then obtain e where "0 < e" and e: "\<forall>y. dist y x < e \<longrightarrow> y = x"
      unfolding open_dist by fast
    define y where "y = x + scaleR (e/2) (SOME b. b \<in> Basis)"
    have [simp]: "(SOME b. b \<in> Basis) \<in> Basis"
      by (rule someI_ex) (auto simp: ex_in_conv)
    from \<open>0 < e\<close> have "y \<noteq> x"
      unfolding y_def by (auto intro!: nonzero_Basis)
    from \<open>0 < e\<close> have "dist y x < e"
      unfolding y_def by (simp add: dist_norm)
    from \<open>y \<noteq> x\<close> and \<open>dist y x < e\<close> show "False"
      using e by simp
  qed
qed

subsection \<open>Class instances\<close>

subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Type \<^typ>\<open>real\<close>\<close>

instantiation real :: euclidean_space
begin

definition
  [simp]: "Basis = {1::real}"

instance
  by standard auto

end

lemma DIM_real[simp]: "DIM(real) = 1"
  by simp

subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Type \<^typ>\<open>complex\<close>\<close>

instantiation complex :: euclidean_space
begin

definition Basis_complex_def: "Basis = {1, \<i>}"

instance
  by standard (auto simp add: Basis_complex_def intro: complex_eqI split: if_split_asm)

end

lemma DIM_complex[simp]: "DIM(complex) = 2"
  unfolding Basis_complex_def by simp

lemma complex_Basis_1 [iff]: "(1::complex) \<in> Basis"
  by (simp add: Basis_complex_def)

lemma complex_Basis_i [iff]: "\<i> \<in> Basis"
  by (simp add: Basis_complex_def)

subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Type \<^typ>\<open>'a \<times> 'b\<close>\<close>

instantiation prod :: (real_inner, real_inner) real_inner
begin

definition inner_prod_def:
  "inner x y = inner (fst x) (fst y) + inner (snd x) (snd y)"

lemma inner_Pair [simp]: "inner (a, b) (c, d) = inner a c + inner b d"
  unfolding inner_prod_def by simp

instance
proof
  fix r :: real
  fix x y z :: "'a::real_inner \<times> 'b::real_inner"
  show "inner x y = inner y x"
    unfolding inner_prod_def
    by (simp add: inner_commute)
  show "inner (x + y) z = inner x z + inner y z"
    unfolding inner_prod_def
    by (simp add: inner_add_left)
  show "inner (scaleR r x) y = r * inner x y"
    unfolding inner_prod_def
    by (simp add: distrib_left)
  show "0 \<le> inner x x"
    unfolding inner_prod_def
    by (intro add_nonneg_nonneg inner_ge_zero)
  show "inner x x = 0 \<longleftrightarrow> x = 0"
    unfolding inner_prod_def prod_eq_iff
    by (simp add: add_nonneg_eq_0_iff)
  show "norm x = sqrt (inner x x)"
    unfolding norm_prod_def inner_prod_def
    by (simp add: power2_norm_eq_inner)
qed

end

lemma inner_Pair_0: "inner x (0, b) = inner (snd x) b" "inner x (a, 0) = inner (fst x) a"
    by (cases x, simp)+

instantiation prod :: (euclidean_space, euclidean_space) euclidean_space
begin

definition
  "Basis = (\<lambda>u. (u, 0)) ` Basis \<union> (\<lambda>v. (0, v)) ` Basis"

lemma sum_Basis_prod_eq:
  fixes f::"('a*'b)\<Rightarrow>('a*'b)"
  shows "sum f Basis = sum (\<lambda>i. f (i, 0)) Basis + sum (\<lambda>i. f (0, i)) Basis"
proof -
  have "inj_on (\<lambda>u. (u::'a, 0::'b)) Basis" "inj_on (\<lambda>u. (0::'a, u::'b)) Basis"
    by (auto intro!: inj_onI Pair_inject)
  thus ?thesis
    unfolding Basis_prod_def
    by (subst sum.union_disjoint) (auto simp: Basis_prod_def sum.reindex)
qed

instance proof
  show "(Basis :: ('a \<times> 'b) set) \<noteq> {}"
    unfolding Basis_prod_def by simp
next
  show "finite (Basis :: ('a \<times> 'b) set)"
    unfolding Basis_prod_def by simp
next
  fix u v :: "'a \<times> 'b"
  assume "u \<in> Basis" and "v \<in> Basis"
  thus "inner u v = (if u = v then 1 else 0)"
    unfolding Basis_prod_def inner_prod_def
    by (auto simp add: inner_Basis split: if_split_asm)
next
  fix x :: "'a \<times> 'b"
  show "(\<forall>u\<in>Basis. inner x u = 0) \<longleftrightarrow> x = 0"
    unfolding Basis_prod_def ball_Un ball_simps
    by (simp add: inner_prod_def prod_eq_iff euclidean_all_zero_iff)
qed

lemma DIM_prod[simp]: "DIM('a \<times> 'b) = DIM('a) + DIM('b)"
  unfolding Basis_prod_def
  by (subst card_Un_disjoint) (auto intro!: card_image arg_cong2[where f="(+)"] inj_onI)

end


subsection \<open>Locale instances\<close>

lemma finite_dimensional_vector_space_euclidean:
  "finite_dimensional_vector_space (*\<^sub>R) Basis"
proof unfold_locales
  show "finite (Basis::'a set)" by (metis finite_Basis)
  have "\<And>a::'a. \<And>u. \<lbrakk>a \<in> Basis; a = (\<Sum>v\<in>Basis - {a}. u v *\<^sub>R v)\<rbrakk> \<Longrightarrow> False"
    apply (drule_tac f="inner a" in arg_cong)
    apply (simp add: inner_Basis inner_sum_right eq_commute)
    done
  then
  show "real_vector.independent (Basis::'a set)"
    unfolding dependent_def dependent_raw_def[symmetric]
    by (subst span_finite) auto
  show "module.span (*\<^sub>R) Basis = UNIV"
    unfolding span_finite [OF finite_Basis] span_raw_def[symmetric]
    by (auto intro!: euclidean_representation[symmetric])
qed

interpretation eucl?: finite_dimensional_vector_space "scaleR :: real => 'a => 'a::euclidean_space" "Basis"
  rewrites "module.dependent (*\<^sub>R) = dependent"
    and "module.representation (*\<^sub>R) = representation"
    and "module.subspace (*\<^sub>R) = subspace"
    and "module.span (*\<^sub>R) = span"
    and "vector_space.extend_basis (*\<^sub>R) = extend_basis"
    and "vector_space.dim (*\<^sub>R) = dim"
    and "Vector_Spaces.linear (*\<^sub>R) (*\<^sub>R) = linear"
    and "Vector_Spaces.linear (*)

    and "finite_dimensional_vector_space.dimension Basis = DIM('a)"
    and "dimension = DIM('a)"
  by (auto simp add: dependent_raw_def representation_raw_def
      subspace_raw_def span_raw_def extend_basis_raw_def dim_raw_def linear_def
      real_scaleR_def[abs_def]
      finite_dimensional_vector_space.dimension_def
      intro!: finite_dimensional_vector_space.dimension_def
      finite_dimensional_vector_space_euclidean)

declare card_set [code] \<comment>\<open>Restore code equation after global interpretation\<close>

interpretation eucl?: finite_dimensional_vector_space_pair_1
  "scaleR::real\'a::euclidean_space\'a" Basis
  "scaleR::real\'b::real_vector \ 'b"
  by unfold_locales

interpretation eucl?: finite_dimensional_vector_space_prod scaleR scaleR Basis Basis
  rewrites "Basis_pair = Basis"
    and "module_prod.scale (*\<^sub>R) (*\<^sub>R) = (scaleR::_\_\('a \ 'b))"
proof -
  show "finite_dimensional_vector_space_prod (*\<^sub>R) (*\<^sub>R) Basis Basis"
    by unfold_locales
  interpret finite_dimensional_vector_space_prod "(*\<^sub>R)" "(*\<^sub>R)" "Basis::'a set" "Basis::'b set"
    by fact
  show "Basis_pair = Basis"
    unfolding Basis_pair_def Basis_prod_def by auto
  show "module_prod.scale (*\<^sub>R) (*\<^sub>R) = scaleR"
    by (fact module_prod_scale_eq_scaleR)
qed

end

99%


¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.