lemma cycle_append [simp]: "⟨a # as @ bs⟩ = ⟨a # bs⟩ * ⟨a # as⟩" proof (induct as rule: cycle.induct) case (3 b c as) thenhave"⟨a # (b # as) @ bs⟩ = ⟨a # bs⟩ * ⟨a # b # as⟩" by simp thenhave"⟨a # as @ bs⟩ * ⟨a ↔ b⟩ = ⟨a # bs⟩ * ⟨a # as⟩ * ⟨a ↔ b⟩" by (simp add: ac_simps) thenhave"⟨a # as @ bs⟩ * ⟨a ↔ b⟩ * ⟨a ↔ b⟩ = ⟨a # bs⟩ * ⟨a # as⟩ * ⟨a ↔ b⟩ * ⟨a ↔ b⟩" by simp thenhave"⟨a # as @ bs⟩ = ⟨a # bs⟩ * ⟨a # as⟩" by (simp add: ac_simps) thenshow"⟨a # (b # c # as) @ bs⟩ = ⟨a # bs⟩ * ⟨a # b # c # as⟩" by (simp add: ac_simps) qed simp_all
lemma affected_cycle: "affected ⟨as⟩⊆ set as" proof (induct as rule: cycle.induct) case (3 a b as) from affected_times have"affected (⟨a # as⟩ * ⟨a ↔ b⟩) ⊆ affected ⟨a # as⟩∪ affected ⟨a ↔ b⟩" . moreoverfrom3 have"affected (⟨a # as⟩) ⊆ insert a (set as)" by simp moreover have"affected ⟨a ↔ b⟩⊆ {a, b}" by (cases "a = b") (simp_all add: affected_swap) ultimatelyhave"affected (⟨a # as⟩ * ⟨a ↔ b⟩) ⊆ insert a (insert b (set as))" by blast thenshow ?caseby auto qed simp_all
lemma orbit_cycle_non_elem: assumes"a ∉ set as" shows"orbit ⟨as⟩ a = {a}" unfolding not_in_affected_iff_orbit_eq_singleton [symmetric] using assms affected_cycle [of as] by blast
lemma inverse_cycle: assumes"distinct as" shows"inverse ⟨as⟩ = ⟨rev as⟩" using assms proof (induct as rule: cycle.induct) case (3 a b as) thenhave *: "inverse ⟨a # as⟩ = ⟨rev (a # as)⟩" and distinct: "distinct (a # b # as)" by simp_all show" inverse ⟨a # b # as⟩ = ⟨rev (a # b # as)⟩" proof (cases as rule: rev_cases) case Nil with * show ?thesis by (simp add: swap_sym) next case (snoc cs c) with distinct have"distinct (a # b # cs @ [c])" by simp thenhave **: "⟨a ↔ b⟩ * ⟨c ↔ a⟩ = ⟨c ↔ a⟩ * ⟨c ↔ b⟩" by transfer (auto simp add: fun_eq_iff transpose_def) with snoc * show ?thesis by (simp add: mult.assoc [symmetric]) qed qed simp_all
lemma order_cycle_non_elem: assumes"a ∉ set as" shows"order ⟨as⟩ a = 1" proof - from assms have"orbit ⟨as⟩ a = {a}" by (rule orbit_cycle_non_elem) thenhave"card (orbit ⟨as⟩ a) = card {a}" by simp thenshow ?thesis by simp qed
lemma orbit_cycle_elem: assumes"distinct as"and"a ∈ set as" shows"orbit ⟨as⟩ a = set as" oops―‹(we need rotation here›
lemma order_cycle_elem: assumes"distinct as"and"a ∈ set as" shows"order ⟨as⟩ a = length as" oops
text‹Adding fixpoints›
definition fixate :: "'a → 'a perm → 'a perm" where "fixate a f = (if a ∈ affected f then f * ⟨inverse f ⟨$⟩ a ↔ a⟩ else f)"
lemma affected_fixate_trivial: assumes"a ∉ affected f" shows"affected (fixate a f) = affected f" using assms by (simp add: fixate_def)
lemma affected_fixate_binary_circle: assumes"order f a = 2" shows"affected (fixate a f) = affected f - {a, apply f a}" (is"?A = ?B") proof (rule set_eqI) interpret bijection "apply f" by standard simp fix b from assms order_greater_eq_two_iff [of f a] have"a ∈ affected f" by simp moreoverhave"apply (f ^ 2) a = a" by (simp add: assms [symmetric]) ultimatelyshow"b ∈ ?A ⟷ b ∈ ?B" by (cases "b ∈ {a, apply (inverse f) a}")
(auto simp add: in_affected power2_eq_square apply_inverse apply_times fixate_def) qed
lemma affected_fixate_no_binary_circle: assumes"order f a > 2" shows"affected (fixate a f) = affected f - {a}" (is"?A = ?B") proof (rule set_eqI) interpret bijection "apply f" by standard simp fix b from assms order_greater_eq_two_iff [of f a] have"a ∈ affected f" by simp moreoverfrom assms have"apply f (apply f a) ≠ a" using apply_power_eq_iff [of f 2 a 0] by (simp add: power2_eq_square apply_times) ultimatelyshow"b ∈ ?A ⟷ b ∈ ?B" by (cases "b ∈ {a, apply (inverse f) a}")
(auto simp add: in_affected apply_inverse apply_times fixate_def) qed
lemma affected_fixate: "affected (fixate a f) ⊆ affected f - {a}" proof - have"a ∉ affected f ∨ order f a = 2 ∨ order f a > 2" by (auto simp add: not_less dest: affected_order_greater_eq_two) then consider "a ∉ affected f" | "order f a = 2" | "order f a > 2" by blast thenshow ?thesis apply cases using affected_fixate_trivial [of a f]
affected_fixate_binary_circle [of f a]
affected_fixate_no_binary_circle [of f a] by auto qed
lemma orbit_fixate_self [simp]: "orbit (fixate a f) a = {a}" proof - have"apply (f * inverse f) a = a" by simp thenhave"apply f (apply (inverse f) a) = a" by (simp only: apply_times comp_apply) thenshow ?thesis by (simp add: fixate_def not_in_affected_iff_orbit_eq_singleton [symmetric] in_affected apply_times) qed
lemma order_fixate_self [simp]: "order (fixate a f) a = 1" proof - have"card (orbit (fixate a f) a) = card {a}" by simp thenshow ?thesis by (simp only: card_orbit_eq) simp qed
lemma assumes"b ∉ orbit f a" shows"orbit (fixate b f) a = orbit f a" oops
lemma assumes"b ∈ orbit f a"and"b ≠ a" shows"orbit (fixate b f) a = orbit f a - {b}" oops
text‹Distilling cycles from permutations›
inductive_set orbits :: "'a perm → 'a set set"for f where
in_orbitsI: "a ∈ affected f ==> orbit f a ∈ orbits f"
lemma orbits_unfold: "orbits f = orbit f ` affected f" by (auto intro: in_orbitsI elim: orbits.cases)
lemma in_orbit_affected: assumes"b ∈ orbit f a" assumes"a ∈ affected f" shows"b ∈ affected f" proof (cases "a = b") case True with assms show ?thesis by simp next case False with assms have"{a, b} ⊆ orbit f a" by auto alsofrom assms have"orbit f a ⊆ affected f" by (blast intro!: orbit_subset_eq_affected) finallyshow ?thesis by simp qed
definition trace :: "'a → 'a perm → 'a list" where "trace a f = map (λn. apply (f ^ n) a) [0..<order f a]"
lemma set_trace_eq [simp]: "set (trace a f) = orbit f a" by (auto simp add: trace_def orbit_unfold_image)
definition seeds :: "'a perm → 'a::linorder list" where "seeds f = sorted_list_of_set (Min ` orbits f)"
definition cycles :: "'a perm → 'a::linorder list list" where "cycles f = map (λa. trace a f) (seeds f)"
end
end
Messung V0.5 in Prozent
¤ 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.14Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-08-25)
¤
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.