lemma starrel_in_star: "starrel``{x} ∈ star" by (simp add: star_def quotientI)
lemma star_n_eq_iff: "star_n X = star_n Y ⟷ eventually (λn. X n = Y n) U" by (simp add: star_n_def Abs_star_inject starrel_in_star equiv_starrel_iff)
subsection‹Transfer principle›
text‹This introduction rule starts each transfer proof.› lemma transfer_start: "P ≡ eventually (λn. Q) U==> Trueprop P ≡ Trueprop Q" by (simp add: FreeUltrafilterNat.proper)
text‹Standard principles that play a central role in the transfer tactic.› definition Ifun :: "('a ==> 'b) star ==> 'a star ==> 'b star"
(‹(‹notation=‹infix ⋆›\›_ ⋆/ _)› [300, 301] 300) where"Ifun f ≡ λx. Abs_star (∪F∈Rep_star f. ∪X∈Rep_star x. starrel``{λn. F n (X n)})"
lemma Ifun_congruent2: "congruent2 starrel starrel (λF X. starrel``{λn. F n (X n)})" by (auto simp add: congruent2_def equiv_starrel_iff elim!: eventually_rev_mp)
lemma Ifun_star_n: "star_n F ⋆ star_n X = star_n (λn. F n (X n))" by (simp add: Ifun_def star_n_def Abs_star_inverse starrel_in_star
UN_equiv_class2 [OF equiv_starrel equiv_starrel Ifun_congruent2])
lemma transfer_Ifun: "f ≡ star_n F ==> x ≡ star_n X ==> f ⋆ x ≡ star_n (λn. F n (X n))" by (simp only: Ifun_star_n)
definition star_of :: "'a ==> 'a star" where"star_of x ≡ star_n (λn. x)"
text‹Initialize transfer tactic.›
ML_file ‹transfer_principle.ML›
lemma transfer_ex [transfer_intro]: "(∧X. p (star_n X) ≡ eventually (λn. P n (X n)) U) ==> ∃x::'a star. p x ≡ eventually (λn. ∃x. P n x) U" by (simp only: ex_star_eq eventually_ex)
lemma transfer_all [transfer_intro]: "(∧X. p (star_n X) ≡ eventually (λn. P n (X n)) U) ==> ∀x::'a star. p x ≡ eventually (λn. ∀x. P n x) U" by (simp only: all_star_eq FreeUltrafilterNat.eventually_all_iff)
lemma transfer_not [transfer_intro]: "p ≡ eventually P U==>¬ p ≡ eventually (λn. ¬ P n) U" by (simp only: FreeUltrafilterNat.eventually_not_iff)
lemma transfer_conj [transfer_intro]: "p ≡ eventually P U==> q ≡ eventually Q U==> p ∧ q ≡ eventually (λn. P n ∧ Q n)U" by (simp only: eventually_conj_iff)
lemma transfer_disj [transfer_intro]: "p ≡ eventually P U==> q ≡ eventually Q U==> p ∨ q ≡ eventually (λn. P n ∨ Q n)U" by (simp only: FreeUltrafilterNat.eventually_disj_iff)
lemma transfer_imp [transfer_intro]: "p ≡ eventually P U==> q ≡ eventually Q U==> p ⟶ q ≡ eventually (λn. P n ⟶ Q n)U" by (simp only: FreeUltrafilterNat.eventually_imp_iff)
lemma transfer_iff [transfer_intro]: "p ≡ eventually P U==> q ≡ eventually Q U==> p = q ≡ eventually (λn. P n = Q n)U" by (simp only: FreeUltrafilterNat.eventually_iff_iff)
lemma transfer_if_bool [transfer_intro]: "p ≡ eventually P U==> x ≡ eventually X U==> y ≡ eventually Y U==> (if p then x else y) ≡ eventually (λn. if P n then X n else Y n) U" by (simp only: if_bool_eq_conj transfer_conj transfer_imp transfer_not)
lemma transfer_eq [transfer_intro]: "x ≡ star_n X ==> y ≡ star_n Y ==> x = y ≡ eventually (λn. X n = Y n) U" by (simp only: star_n_eq_iff)
lemma transfer_if [transfer_intro]: "p ≡ eventually (λn. P n) U==> x ≡ star_n X ==> y ≡ star_n Y ==> (if p then x else y) ≡ star_n (λn. if P n then X n else Y n)" by (rule eq_reflection) (auto simp: star_n_eq_iff transfer_not elim!: eventually_mono)
lemma transfer_fun_eq [transfer_intro]: "(∧X. f (star_n X) = g (star_n X) ≡ eventually (λn. F n (X n) = G n (X n)) U) ==> f = g ≡ eventually (λn. F n = G n) U" by (simp only: fun_eq_iff transfer_all)
lemma transfer_star_n [transfer_intro]: "star_n X ≡ star_n (λn. X n)" by (rule reflexive)
lemma transfer_bool [transfer_intro]: "p ≡ eventually (λn. p) U" by (simp add: FreeUltrafilterNat.proper)
subsection‹Standard elements›
definition Standard :: "'a star set" where"Standard = range star_of"
text‹Transfer tactic should remove occurrences of 🍋‹star_of›.› setup‹Transfer_Principle.add_const 🍋‹star_of›\›
lemma star_of_inject: "star_of x = star_of y ⟷ x = y" by transfer (rule refl)
lemma Standard_star_of [simp]: "star_of x ∈ Standard" by (simp add: Standard_def)
subsection‹Internal functions›
text‹Transfer tactic should remove occurrences of 🍋‹Ifun›.› setup‹Transfer_Principle.add_const 🍋‹Ifun›\›
lemma Ifun_star_of [simp]: "star_of f ⋆ star_of x = star_of (f x)" by transfer (rule refl)
lemma Standard_Ifun [simp]: "f ∈ Standard ==> x ∈ Standard ==> f ⋆ x ∈ Standard" by (auto simp add: Standard_def)
text‹Nonstandard extensions of functions.›
definition starfun :: "('a ==> 'b) ==> 'a star ==> 'b star"
(‹(‹open_block notation=‹prefix starfun›\›*f* _)› [80] 80) where"starfun f ≡ λx. star_of f ⋆ x"
definition starfun2 :: "('a ==> 'b ==> 'c) ==> 'a star ==> 'b star ==> 'c star"
(‹(‹open_block notation=‹prefix starfun2›\›*f2* _)› [80] 80) where"starfun2 f ≡ λx y. star_of f ⋆ x ⋆ y"
lemma starfun_star_of [simp]: "( *f* f) (star_of x) = star_of (f x)" by transfer (rule refl)
lemma starfun2_star_of [simp]: "( *f2* f) (star_of x) = *f* f x" by transfer (rule refl)
lemma Standard_starfun [simp]: "x ∈ Standard ==> starfun f x ∈ Standard" by (simp add: starfun_def)
lemma Standard_starfun2 [simp]: "x ∈ Standard ==> y ∈ Standard ==> starfun2 f x y ∈ Standard" by (simp add: starfun2_def)
lemma Standard_starfun_iff: assumes inj: "∧x y. f x = f y ==> x = y" shows"starfun f x ∈ Standard ⟷ x ∈ Standard" proof assume"x ∈ Standard" thenshow"starfun f x ∈ Standard"by simp next from inj have inj': "∧x y. starfun f x = starfun f y ==> x = y" by transfer assume"starfun f x ∈ Standard" thenobtain b where b: "starfun f x = star_of b" unfolding Standard_def .. thenhave"∃x. starfun f x = star_of b" .. thenhave"∃a. f a = b"by transfer thenobtain a where"f a = b" .. thenhave"starfun f (star_of a) = star_of b"by transfer with b have"starfun f x = starfun f (star_of a)"by simp thenhave"x = star_of a"by (rule inj') thenshow"x ∈ Standard"by (simp add: Standard_def) qed
lemma Standard_starfun2_iff: assumes inj: "∧a b a' b'. f a b = f a' b' ==> a = a' ∧ b = b'" shows"starfun2 f x y ∈ Standard ⟷ x ∈ Standard ∧ y ∈ Standard" proof assume"x ∈ Standard ∧ y ∈ Standard" thenshow"starfun2 f x y ∈ Standard"by simp next have inj': "∧x y z w. starfun2 f x y = starfun2 f z w ==> x = z ∧ y = w" using inj by transfer assume"starfun2 f x y ∈ Standard" thenobtain c where c: "starfun2 f x y = star_of c" unfolding Standard_def .. thenhave"∃x y. starfun2 f x y = star_of c"by auto thenhave"∃a b. f a b = c"by transfer thenobtain a b where"f a b = c"by auto thenhave"starfun2 f (star_of a) (star_of b) = star_of c"by transfer with c have"starfun2 f x y = starfun2 f (star_of a) (star_of b)"by simp thenhave"x = star_of a ∧ y = star_of b"by (rule inj') thenshow"x ∈ Standard ∧ y ∈ Standard"by (simp add: Standard_def) qed
subsection‹Internal predicates›
definition unstar :: "bool star ==> bool" where"unstar b ⟷ b = star_of True"
lemma unstar_star_n: "unstar (star_n P) ⟷ eventually P U" by (simp add: unstar_def star_of_def star_n_eq_iff)
text‹Transfer tactic should remove occurrences of 🍋‹unstar›.› setup‹Transfer_Principle.add_const 🍋‹unstar›\›
lemma transfer_unstar [transfer_intro]: "p ≡ star_n P ==> unstar p ≡ eventually P U" by (simp only: unstar_star_n)
definition starP :: "('a ==> bool) ==> 'a star ==> bool"
(‹(‹open_block notation=‹prefix starP›\›*p* _)› [80] 80) where"*p* P = (λx. unstar (star_of P ⋆ x))"
definition starP2 :: "('a ==> 'b ==> bool) ==> 'a star ==> 'b star ==> bool"
(‹(‹open_block notation=‹prefix starP2›\›*p2* _)› [80] 80) where"*p2* P = (λx y. unstar (star_of P ⋆ x ⋆ y))"
lemma starP_star_of [simp]: "( *p* P) (star_of x) = P x" by transfer (rule refl)
lemma starP2_star_of [simp]: "( *p2* P) (star_of x) = *p* P x" by transfer (rule refl)
subsection‹Internal sets›
definition Iset :: "'a set star ==> 'a star set" where"Iset A = {x. ( *p2* (∈)) x A}"
lemma Iset_star_n: "(star_n X ∈ Iset (star_n A)) = (eventually (λn. X n ∈ A n) U)" by (simp add: Iset_def starP2_star_n)
text‹Transfer tactic should remove occurrences of 🍋‹Iset›.› setup‹Transfer_Principle.add_const 🍋‹Iset›\›
lemma transfer_mem [transfer_intro]: "x ≡ star_n X ==> a ≡ Iset (star_n A) ==> x ∈ a ≡ eventually (λn. X n ∈ A n) U" by (simp only: Iset_star_n)
lemma transfer_Collect [transfer_intro]: "(∧X. p (star_n X) ≡ eventually (λn. P n (X n)) U) ==> Collect p ≡ Iset (star_n (λn. Collect (P n)))" by (simp add: atomize_eq set_eq_iff all_star_eq Iset_star_n)
lemma transfer_set_eq [transfer_intro]: "a ≡ Iset (star_n A) ==> b ≡ Iset (star_n B) ==> a = b ≡ eventually (λn. A n = B n) U" by (simp only: set_eq_iff transfer_all transfer_iff transfer_mem)
lemma transfer_ball [transfer_intro]: "a ≡ Iset (star_n A) ==> (∧X. p (star_n X) ≡ eventually (λn. P n (X n)) U) ==> ∀x∈a. p x ≡ eventually (λn. ∀x∈A n. P n x) U" by (simp only: Ball_def transfer_all transfer_imp transfer_mem)
lemma transfer_bex [transfer_intro]: "a ≡ Iset (star_n A) ==> (∧X. p (star_n X) ≡ eventually (λn. P n (X n)) U) ==> ∃x∈a. p x ≡ eventually (λn. ∃x∈A n. P n x) U" by (simp only: Bex_def transfer_ex transfer_conj transfer_mem)
lemma transfer_Iset [transfer_intro]: "a ≡ star_n A ==> Iset a ≡ Iset (star_n (λn. A n))" by simp
text‹Nonstandard extensions of sets.›
definition starset :: "'a set ==> 'a star set"
(‹(‹open_block notation=‹prefix starset›\›*s* _)› [80] 80) where"starset A = Iset (star_of A)"
declare starset_def [transfer_unfold]
lemma starset_mem: "star_of x ∈ *s* A ⟷ x ∈ A" by transfer (rule refl)
lemma starset_UNIV: "*s* (UNIV::'a set) = (UNIV::'a star set)" by (transfer UNIV_def) (rule refl)
instance star :: (order) order proof show"∧x y::'a star. (x < y) = (x ≤ y ∧¬ y ≤ x)" by transfer (rule less_le_not_le) show"∧x::'a star. x ≤ x" by transfer (rule order_refl) show"∧x y z::'a star. [x ≤ y; y ≤ z]==> x ≤ z" by transfer (rule order_trans) show"∧x y::'a star. [x ≤ y; y ≤ x]==> x = y" by transfer (rule order_antisym) qed
instantiation star :: (semilattice_inf) semilattice_inf begin definition star_inf_def [transfer_unfold]: "inf ≡ *f2* inf" instanceby (standard; transfer) auto end
instantiation star :: (semilattice_sup) semilattice_sup begin definition star_sup_def [transfer_unfold]: "sup ≡ *f2* sup" instanceby (standard; transfer) auto end
instance star :: (lattice) lattice ..
instance star :: (distrib_lattice) distrib_lattice by (standard; transfer) (auto simp add: sup_inf_distrib1)
lemma Standard_inf [simp]: "x ∈ Standard ==> y ∈ Standard ==> inf x y ∈ Standard" by (simp add: star_inf_def)
lemma Standard_sup [simp]: "x ∈ Standard ==> y ∈ Standard ==> sup x y ∈ Standard" by (simp add: star_sup_def)
lemma star_of_inf [simp]: "star_of (inf x y) = inf (star_of x) (star_of y)" by transfer (rule refl)
lemma star_of_sup [simp]: "star_of (sup x y) = sup (star_of x) (star_of y)" by transfer (rule refl)
instance star :: (linorder) linorder by (intro_classes, transfer, rule linorder_linear)
instance star :: (ordered_ab_semigroup_add) ordered_ab_semigroup_add by (intro_classes, transfer, rule add_left_mono)
instance star :: (ordered_cancel_ab_semigroup_add) ordered_cancel_ab_semigroup_add ..
instance star :: (ordered_ab_semigroup_add_imp_le) ordered_ab_semigroup_add_imp_le by (intro_classes, transfer, rule add_le_imp_le_left)
instance star :: (ordered_comm_monoid_add) ordered_comm_monoid_add .. instance star :: (ordered_ab_semigroup_monoid_add_imp_le) ordered_ab_semigroup_monoid_add_imp_le .. instance star :: (ordered_cancel_comm_monoid_add) ordered_cancel_comm_monoid_add .. instance star :: (ordered_ab_group_add) ordered_ab_group_add ..
instance star :: (ordered_ab_group_add_abs) ordered_ab_group_add_abs by intro_classes (transfer, simp add: abs_ge_self abs_leI abs_triangle_ineq)+
instance star :: (linordered_cancel_ab_semigroup_add) linordered_cancel_ab_semigroup_add ..
subsection‹Ring and field classes›
instance star :: (semiring) semiring by (intro_classes; transfer) (fact distrib_right distrib_left)+
instance star :: (semiring_0) semiring_0 by (intro_classes; transfer) simp_all
instance star :: (semiring_0_cancel) semiring_0_cancel ..
instance star :: (comm_semiring) comm_semiring by (intro_classes; transfer) (fact distrib_right)
instance star :: (comm_semiring_0) comm_semiring_0 .. instance star :: (comm_semiring_0_cancel) comm_semiring_0_cancel ..
instance star :: (zero_neq_one) zero_neq_one by (intro_classes; transfer) (fact zero_neq_one)
instance star :: (semiring_1) semiring_1 .. instance star :: (comm_semiring_1) comm_semiring_1 ..
declare dvd_def [transfer_refold]
instance star :: (comm_semiring_1_cancel) comm_semiring_1_cancel by (intro_classes; transfer) (fact right_diff_distrib')
instance star :: (semiring_no_zero_divisors) semiring_no_zero_divisors by (intro_classes; transfer) (fact no_zero_divisors)
instance star :: (semiring_1_no_zero_divisors) semiring_1_no_zero_divisors ..
instance star :: (semiring_no_zero_divisors_cancel) semiring_no_zero_divisors_cancel by (intro_classes; transfer) simp_all
instance star :: (semiring_1_cancel) semiring_1_cancel .. instance star :: (ring) ring .. instance star :: (comm_ring) comm_ring .. instance star :: (ring_1) ring_1 .. instance star :: (comm_ring_1) comm_ring_1 .. instance star :: (semidom) semidom ..
instance star :: (semidom_divide) semidom_divide by (intro_classes; transfer) simp_all
instance star :: (ring_no_zero_divisors) ring_no_zero_divisors .. instance star :: (ring_1_no_zero_divisors) ring_1_no_zero_divisors .. instance star :: (idom) idom .. instance star :: (idom_divide) idom_divide ..
instance star :: (divide_trivial) divide_trivial by (intro_classes; transfer) simp_all
instance star :: (division_ring) division_ring by (intro_classes; transfer) (simp_all add: divide_inverse)
instance star :: (field) field by (intro_classes; transfer) (simp_all add: divide_inverse)
instance star :: (ordered_semiring) ordered_semiring by (intro_classes; transfer) (fact mult_left_mono mult_right_mono)+
instance star :: (ordered_cancel_semiring) ordered_cancel_semiring ..
instance star :: (linordered_semiring_strict) linordered_semiring_strict by (intro_classes; transfer) (fact mult_strict_left_mono mult_strict_right_mono)+
instance star :: (ordered_comm_semiring) ordered_comm_semiring by (intro_classes; transfer) (fact mult_left_mono)
instance star :: (ordered_cancel_comm_semiring) ordered_cancel_comm_semiring ..
instance star :: (linordered_comm_semiring_strict) linordered_comm_semiring_strict by (intro_classes; transfer) (fact mult_strict_left_mono)
instance star :: (ordered_ring) ordered_ring ..
instance star :: (ordered_ring_abs) ordered_ring_abs by (intro_classes; transfer) (fact abs_eq_mult)
instance star :: (abs_if) abs_if by (intro_classes; transfer) (fact abs_if)
instance star :: (linordered_ring_strict) linordered_ring_strict .. instance star :: (ordered_comm_ring) ordered_comm_ring ..
instance star :: (linordered_semidom) linordered_semidom by (intro_classes; transfer) (fact zero_less_one le_add_diff_inverse2)+
instance star :: (linordered_idom) linordered_idom by (intro_classes; transfer) (fact sgn_if)
instance star :: (linordered_field) linordered_field ..
instance star :: (algebraic_semidom) algebraic_semidom ..
instantiation star :: (normalization_semidom) normalization_semidom begin
definition unit_factor_star :: "'a star ==> 'a star" where [transfer_unfold]: "unit_factor_star = *f* unit_factor"
definition normalize_star :: "'a star ==> 'a star" where [transfer_unfold]: "normalize_star = *f* normalize"
instance by standard (transfer; simp add: is_unit_unit_factor unit_factor_mult)+
end
instance star :: (semidom_modulo) semidom_modulo by standard (transfer; simp)
subsection‹Power›
lemma star_power_def [transfer_unfold]: "(^) ≡ λx n. ( *f* (λx. x ^ n)) x" proof (rule eq_reflection, rule ext, rule ext) show"x ^ n = ( *f* (λx. x ^ n)) x"for n :: nat and x :: "'a star" proof (induct n arbitrary: x) case 0 have"∧x::'a star. ( *f* (λx. 1)) x = 1" by transfer simp thenshow ?caseby simp next case (Suc n) have"∧x::'a star. x * ( *f* (λx::'a. x ^ n)) x = ( *f* (λx::'a. x * x ^ n)) x" by transfer simp with Suc show ?caseby simp qed qed
lemma Standard_power [simp]: "x ∈ Standard ==> x ^ n ∈ Standard" by (simp add: star_power_def)
lemma star_of_power [simp]: "star_of (x ^ n) = star_of x ^ n" by transfer (rule refl)
subsection‹Number classes›
instance star :: (numeral) numeral ..
lemma star_numeral_def [transfer_unfold]: "numeral k = star_of (numeral k)" by (induct k) (simp_all only: numeral.simps star_of_one star_of_add)
lemma Standard_numeral [simp]: "numeral k ∈ Standard" by (simp add: star_numeral_def)
lemma star_of_numeral [simp]: "star_of (numeral k) = numeral k" by transfer (rule refl)
lemma star_of_nat_def [transfer_unfold]: "of_nat n = star_of (of_nat n)" by (induct n) simp_all
lemma Standard_of_nat [simp]: "of_nat n ∈ Standard" by (simp add: star_of_nat_def)
lemma star_of_of_nat [simp]: "star_of (of_nat n) = of_nat n" by transfer (rule refl)
lemma star_of_int_def [transfer_unfold]: "of_int z = star_of (of_int z)" by (rule int_diff_cases [of z]) simp
lemma Standard_of_int [simp]: "of_int z ∈ Standard" by (simp add: star_of_int_def)
lemma star_of_of_int [simp]: "star_of (of_int z) = of_int z" by transfer (rule refl)
instance star :: (semiring_char_0) semiring_char_0 proof have"inj (star_of :: 'a ==> 'a star)" by (rule injI) simp thenhave"inj (star_of ∘ of_nat :: nat ==> 'a star)" using inj_of_nat by (rule inj_compose) thenshow"inj (of_nat :: nat ==> 'a star)" by (simp add: comp_def) qed
instance star :: (ring_char_0) ring_char_0 ..
subsection‹Finite class›
lemma starset_finite: "finite A ==> *s* A = star_of ` A" by (erule finite_induct) simp_all
instance star :: (finite) finite proof intro_classes show"finite (UNIV::'a star set)" by (metis starset_UNIV finite finite_imageI starset_finite) qed
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet am 2026-04-26)
¤
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 und die Messung sind noch experimentell.