[STATEMENT]
theorem strict_extends_preorder_on:
  assumes "preorder_on A base_r"
  shows "\<exists>r. total_preorder_on A r \<and> strict_extends r base_r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
text \<open>
    We define an order on the set of strict extensions of the base relation \<^term>\<open>base_r\<close>,
    where \<^term>\<open>r \<le> s\<close> iff \<^term>\<open>strict_extends r base_r\<close> and \<^term>\<open>strict_extends s r\<close>:
  \<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
define order_of_orders :: "('a rel) rel" where "order_of_orders =
    Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. preorder_on A r}"
[PROOF STATE]
proof (state)
this:
order_of_orders = Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. preorder_on A r}

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
text \<open>
    We show that this order consists of those relations that are preorders and that strictly extend
    the base relation \<^term>\<open>base_r\<close>
  \<close>
[PROOF STATE]
proof (state)
this:
order_of_orders = Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. preorder_on A r}

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
have Field_order_of_orders: "Field order_of_orders =
    {r. preorder_on A r \<and> strict_extends r base_r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field order_of_orders = {r. preorder_on A r \<and> strict_extends r base_r}
[PROOF STEP]
using transp_strict_extends
[PROOF STATE]
proof (prove)
using this:
transp strict_extends

goal (1 subgoal):
 1. Field order_of_orders = {r. preorder_on A r \<and> strict_extends r base_r}
[PROOF STEP]
proof(safe)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> preorder_on A x
 2. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> strict_extends x base_r
 3. \<And>x. \<lbrakk>transp strict_extends; preorder_on A x; strict_extends x base_r\<rbrakk> \<Longrightarrow> x \<in> Field order_of_orders
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> preorder_on A x
 2. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> strict_extends x base_r
 3. \<And>x. \<lbrakk>transp strict_extends; preorder_on A x; strict_extends x base_r\<rbrakk> \<Longrightarrow> x \<in> Field order_of_orders
[PROOF STEP]
assume "preorder_on A r" "strict_extends r base_r"
[PROOF STATE]
proof (state)
this:
preorder_on A r
strict_extends r base_r

goal (3 subgoals):
 1. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> preorder_on A x
 2. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> strict_extends x base_r
 3. \<And>x. \<lbrakk>transp strict_extends; preorder_on A x; strict_extends x base_r\<rbrakk> \<Longrightarrow> x \<in> Field order_of_orders
[PROOF STEP]
with reflp_strict_extends
[PROOF STATE]
proof (chain)
picking this:
reflp strict_extends
preorder_on A r
strict_extends r base_r
[PROOF STEP]
have
      "(r, r) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r}"
[PROOF STATE]
proof (prove)
using this:
reflp strict_extends
preorder_on A r
strict_extends r base_r

goal (1 subgoal):
 1. (r, r) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
by (auto elim!: reflpE)
[PROOF STATE]
proof (state)
this:
(r, r) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (3 subgoals):
 1. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> preorder_on A x
 2. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> strict_extends x base_r
 3. \<And>x. \<lbrakk>transp strict_extends; preorder_on A x; strict_extends x base_r\<rbrakk> \<Longrightarrow> x \<in> Field order_of_orders
[PROOF STEP]
with \<open>preorder_on A r\<close>
[PROOF STATE]
proof (chain)
picking this:
preorder_on A r
(r, r) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
show "r \<in> Field order_of_orders"
[PROOF STATE]
proof (prove)
using this:
preorder_on A r
(r, r) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (1 subgoal):
 1. r \<in> Field order_of_orders
[PROOF STEP]
unfolding order_of_orders_def
[PROOF STATE]
proof (prove)
using this:
preorder_on A r
(r, r) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (1 subgoal):
 1. r \<in> Field (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A)))
[PROOF STEP]
by (auto simp: Field_def)
[PROOF STATE]
proof (state)
this:
r \<in> Field order_of_orders

goal (2 subgoals):
 1. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> preorder_on A x
 2. \<And>x. \<lbrakk>transp strict_extends; x \<in> Field order_of_orders\<rbrakk> \<Longrightarrow> strict_extends x base_r
[PROOF STEP]
qed (auto simp: order_of_orders_def Field_def elim: transpE)
[PROOF STATE]
proof (state)
this:
Field order_of_orders = {r. preorder_on A r \<and> strict_extends r base_r}

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
text \<open>
    We now show that this set has a maximum and that any maximum of this set is a total preorder
    and as thus is one of the extensions we are looking for.
    We begin by showing the existence of a maximal element using Zorn's lemma.
  \<close>
[PROOF STATE]
proof (state)
this:
Field order_of_orders = {r. preorder_on A r \<and> strict_extends r base_r}

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
have "\<exists>m \<in> Field order_of_orders.
      \<forall>a \<in> Field order_of_orders. (m, a) \<in> order_of_orders \<longrightarrow> a = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m\<in>Field order_of_orders. \<forall>a\<in>Field order_of_orders. (m, a) \<in> order_of_orders \<longrightarrow> a = m
[PROOF STEP]
proof (rule Zorns_po_lemma_nonempty)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
text \<open>
      Zorn's Lemma requires us to prove that our \<^term>\<open>order_of_orders\<close> is a nonempty partial order
      and that every nonempty chain has an upper bound.
      The partial order property is trivial, since we used \<^term>\<open>strict_extends\<close> for the relation,
      which is a partial order as shown above.
    \<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
from reflp_strict_extends transp_strict_extends
[PROOF STATE]
proof (chain)
picking this:
reflp strict_extends
transp strict_extends
[PROOF STEP]
have "Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}"
[PROOF STATE]
proof (prove)
using this:
reflp strict_extends
transp strict_extends

goal (1 subgoal):
 1. Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
unfolding refl_on_def Field_def
[PROOF STATE]
proof (prove)
using this:
reflp strict_extends
transp strict_extends

goal (1 subgoal):
 1. {(r, s). strict_extends r base_r \<and> strict_extends s r} \<subseteq> (Domain {(r, s). strict_extends r base_r \<and> strict_extends s r} \<union> Range {(r, s). strict_extends r base_r \<and> strict_extends s r}) \<times> (Domain {(r, s). strict_extends r base_r \<and> strict_extends s r} \<union> Range {(r, s). strict_extends r base_r \<and> strict_extends s r}) \<and> (\<forall>x\<in>Domain {(r, s). strict_extends r base_r \<and> strict_extends s r} \<union> Range {(r, s). strict_extends r base_r \<and> strict_extends s r}. (x, x) \<in> {(r, s). strict_extends r base_r \<and> strict_extends s r})
[PROOF STEP]
by (auto elim: transpE reflpE)
[PROOF STATE]
proof (state)
this:
Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
have "trans {(r, s). strict_extends r base_r \<and> strict_extends s r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
using transp_strict_extends
[PROOF STATE]
proof (prove)
using this:
transp strict_extends

goal (1 subgoal):
 1. trans {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
by (auto elim: transpE intro: transI)
[PROOF STATE]
proof (state)
this:
trans {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
trans {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
have "antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
using antisymp_strict_extends
[PROOF STATE]
proof (prove)
using this:
antisymp strict_extends

goal (1 subgoal):
 1. antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
by (fastforce dest: antisympD intro: antisymI)
[PROOF STATE]
proof (state)
this:
antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (3 subgoals):
 1. Partial_order order_of_orders
 2. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 3. order_of_orders \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}
trans {(r, s). strict_extends r base_r \<and> strict_extends s r}
antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}
[PROOF STEP]
show "Partial_order order_of_orders"
[PROOF STATE]
proof (prove)
using this:
Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}
trans {(r, s). strict_extends r base_r \<and> strict_extends s r}
antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (1 subgoal):
 1. Partial_order order_of_orders
[PROOF STEP]
unfolding order_of_orders_def order_on_defs
[PROOF STATE]
proof (prove)
using this:
Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}
trans {(r, s). strict_extends r base_r \<and> strict_extends s r}
antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}

goal (1 subgoal):
 1. (Refl (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. refl_on A r \<and> trans r}) \<and> trans (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. refl_on A r \<and> trans r})) \<and> antisym (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. refl_on A r \<and> trans r})
[PROOF STEP]
using Field_order_of_orders Refl_Restr trans_Restr antisym_Restr
[PROOF STATE]
proof (prove)
using this:
Refl {(r, s). strict_extends r base_r \<and> strict_extends s r}
trans {(r, s). strict_extends r base_r \<and> strict_extends s r}
antisym {(r, s). strict_extends r base_r \<and> strict_extends s r}
Field order_of_orders = {r. preorder_on A r \<and> strict_extends r base_r}
Refl ?r \<Longrightarrow> Refl (Restr ?r ?A)
trans ?r \<Longrightarrow> trans (Restr ?r ?A)
antisym ?r \<Longrightarrow> antisym (Restr ?r ?A)

goal (1 subgoal):
 1. (Refl (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. refl_on A r \<and> trans r}) \<and> trans (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. refl_on A r \<and> trans r})) \<and> antisym (Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} {r. refl_on A r \<and> trans r})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Partial_order order_of_orders

goal (2 subgoals):
 1. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 2. order_of_orders \<noteq> {}
[PROOF STEP]
text \<open>Also, our order is obviously not empty since it contains \<^term>\<open>(base_r, base_r)\<close>:\<close>
[PROOF STATE]
proof (state)
this:
Partial_order order_of_orders

goal (2 subgoals):
 1. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 2. order_of_orders \<noteq> {}
[PROOF STEP]
have "(base_r, base_r) \<in> order_of_orders"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (base_r, base_r) \<in> order_of_orders
[PROOF STEP]
unfolding order_of_orders_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (base_r, base_r) \<in> Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A))
[PROOF STEP]
using assms reflp_strict_extends
[PROOF STATE]
proof (prove)
using this:
preorder_on A base_r
reflp strict_extends

goal (1 subgoal):
 1. (base_r, base_r) \<in> Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A))
[PROOF STEP]
by (auto dest: reflpD)
[PROOF STATE]
proof (state)
this:
(base_r, base_r) \<in> order_of_orders

goal (2 subgoals):
 1. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
 2. order_of_orders \<noteq> {}
[PROOF STEP]
thus "order_of_orders \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
(base_r, base_r) \<in> order_of_orders

goal (1 subgoal):
 1. order_of_orders \<noteq> {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
order_of_orders \<noteq> {}

goal (1 subgoal):
 1. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
[PROOF STEP]
text \<open>
      Next we show that each chain has an upper bound.
      For the upper bound we take the union of all relations in the chain.
    \<close>
[PROOF STATE]
proof (state)
this:
order_of_orders \<noteq> {}

goal (1 subgoal):
 1. \<And>C. \<lbrakk>C \<in> Chains order_of_orders; C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
[PROOF STEP]
show "\<exists>u \<in> Field order_of_orders. \<forall>a \<in> C. (a, u) \<in> order_of_orders"
      if C_def: "C \<in> Chains order_of_orders" and C_nonempty: "C \<noteq> {}"
      for C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u\<in>Field order_of_orders. \<forall>a\<in>C. (a, u) \<in> order_of_orders
[PROOF STEP]
proof (rule bexI[where x="\<Union>C"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
text \<open>
        Obviously each element in the chain is a strict extension of \<^term>\<open>base_r\<close> by definition
        and as such it is also a preorder.
      \<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
have preorder_r: "preorder_on A r" and extends_r: "strict_extends r base_r" if "r \<in> C" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preorder_on A r &&& strict_extends r base_r
[PROOF STEP]
using that C_def[unfolded order_of_orders_def Chains_def]
[PROOF STATE]
proof (prove)
using this:
r \<in> C
C \<in> {C. \<forall>a\<in>C. \<forall>b\<in>C. (a, b) \<in> Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A)) \<or> (b, a) \<in> Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A))}

goal (1 subgoal):
 1. preorder_on A r &&& strict_extends r base_r
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
?r \<in> C \<Longrightarrow> preorder_on A ?r
?r \<in> C \<Longrightarrow> strict_extends ?r base_r

goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
text \<open>
        Because a chain is partially ordered, the union of the chain is reflexive and transitive.
      \<close>
[PROOF STATE]
proof (state)
this:
?r \<in> C \<Longrightarrow> preorder_on A ?r
?r \<in> C \<Longrightarrow> strict_extends ?r base_r

goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
have total_subs_C: "r \<subseteq> s \<or> s \<subseteq> r" if "r \<in> C" and "s \<in> C" for r s
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> s \<or> s \<subseteq> r
[PROOF STEP]
using C_def that
[PROOF STATE]
proof (prove)
using this:
C \<in> Chains order_of_orders
r \<in> C
s \<in> C

goal (1 subgoal):
 1. r \<subseteq> s \<or> s \<subseteq> r
[PROOF STEP]
unfolding Chains_def order_of_orders_def strict_extends_def extends_def
[PROOF STATE]
proof (prove)
using this:
C \<in> {C. \<forall>a\<in>C. \<forall>b\<in>C. (a, b) \<in> Restr {(r, s). ((base_r \<subseteq> r \<and> asym_factor base_r \<subseteq> asym_factor r) \<and> sym_factor r \<subseteq> (sym_factor base_r)\<^sup>=) \<and> (r \<subseteq> s \<and> asym_factor r \<subseteq> asym_factor s) \<and> sym_factor s \<subseteq> (sym_factor r)\<^sup>=} (Collect (preorder_on A)) \<or> (b, a) \<in> Restr {(r, s). ((base_r \<subseteq> r \<and> asym_factor base_r \<subseteq> asym_factor r) \<and> sym_factor r \<subseteq> (sym_factor base_r)\<^sup>=) \<and> (r \<subseteq> s \<and> asym_factor r \<subseteq> asym_factor s) \<and> sym_factor s \<subseteq> (sym_factor r)\<^sup>=} (Collect (preorder_on A))}
r \<in> C
s \<in> C

goal (1 subgoal):
 1. r \<subseteq> s \<or> s \<subseteq> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?r \<in> C; ?s \<in> C\<rbrakk> \<Longrightarrow> ?r \<subseteq> ?s \<or> ?s \<subseteq> ?r

goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
have preorder_UnC: "preorder_on A (\<Union>C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preorder_on A (\<Union> C)
[PROOF STEP]
proof(intro preorder_onI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. refl_on A (\<Union> C)
 2. trans (\<Union> C)
[PROOF STEP]
show "refl_on A (\<Union>C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on A (\<Union> C)
[PROOF STEP]
using preorder_onD(1)[OF preorder_r] C_nonempty
[PROOF STATE]
proof (prove)
using this:
?r \<in> C \<Longrightarrow> refl_on A ?r
C \<noteq> {}

goal (1 subgoal):
 1. refl_on A (\<Union> C)
[PROOF STEP]
unfolding refl_on_def
[PROOF STATE]
proof (prove)
using this:
?r \<in> C \<Longrightarrow> ?r \<subseteq> A \<times> A \<and> (\<forall>x\<in>A. (x, x) \<in> ?r)
C \<noteq> {}

goal (1 subgoal):
 1. \<Union> C \<subseteq> A \<times> A \<and> (\<forall>x\<in>A. (x, x) \<in> \<Union> C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
refl_on A (\<Union> C)

goal (1 subgoal):
 1. trans (\<Union> C)
[PROOF STEP]
from total_subs_C
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?r \<in> C; ?s \<in> C\<rbrakk> \<Longrightarrow> ?r \<subseteq> ?s \<or> ?s \<subseteq> ?r
[PROOF STEP]
show "trans (\<Union>C)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r \<in> C; ?s \<in> C\<rbrakk> \<Longrightarrow> ?r \<subseteq> ?s \<or> ?s \<subseteq> ?r

goal (1 subgoal):
 1. trans (\<Union> C)
[PROOF STEP]
using chain_subset_trans_Union[unfolded chain_subset_def]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r \<in> C; ?s \<in> C\<rbrakk> \<Longrightarrow> ?r \<subseteq> ?s \<or> ?s \<subseteq> ?r
\<lbrakk>\<forall>A\<in>?R. \<forall>B\<in>?R. A \<subseteq> B \<or> B \<subseteq> A; \<forall>r\<in>?R. trans r\<rbrakk> \<Longrightarrow> trans (\<Union> ?R)

goal (1 subgoal):
 1. trans (\<Union> C)
[PROOF STEP]
by (metis preorder_onD(2)[OF preorder_r])
[PROOF STATE]
proof (state)
this:
trans (\<Union> C)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
preorder_on A (\<Union> C)

goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
text \<open>We show that \<^term>\<open>\<Union>C\<close> strictly extends the base relation.\<close>
[PROOF STATE]
proof (state)
this:
preorder_on A (\<Union> C)

goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
have strict_extends_UnC: "strict_extends (\<Union>C) base_r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_extends (\<Union> C) base_r
[PROOF STEP]
proof(intro strict_extendsI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. base_r \<subseteq> \<Union> C
 2. asym_factor base_r \<subseteq> asym_factor (\<Union> C)
 3. sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=
[PROOF STEP]
note extends_r_unfolded = extends_r[unfolded extends_def strict_extends_def]
[PROOF STATE]
proof (state)
this:
?r \<in> C \<Longrightarrow> (base_r \<subseteq> ?r \<and> asym_factor base_r \<subseteq> asym_factor ?r) \<and> sym_factor ?r \<subseteq> (sym_factor base_r)\<^sup>=

goal (3 subgoals):
 1. base_r \<subseteq> \<Union> C
 2. asym_factor base_r \<subseteq> asym_factor (\<Union> C)
 3. sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=
[PROOF STEP]
show "base_r \<subseteq> (\<Union>C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. base_r \<subseteq> \<Union> C
[PROOF STEP]
using C_nonempty extends_r_unfolded
[PROOF STATE]
proof (prove)
using this:
C \<noteq> {}
?r \<in> C \<Longrightarrow> (base_r \<subseteq> ?r \<and> asym_factor base_r \<subseteq> asym_factor ?r) \<and> sym_factor ?r \<subseteq> (sym_factor base_r)\<^sup>=

goal (1 subgoal):
 1. base_r \<subseteq> \<Union> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
base_r \<subseteq> \<Union> C

goal (2 subgoals):
 1. asym_factor base_r \<subseteq> asym_factor (\<Union> C)
 2. sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
base_r \<subseteq> \<Union> C
[PROOF STEP]
show "asym_factor base_r \<subseteq> asym_factor (\<Union>C)"
[PROOF STATE]
proof (prove)
using this:
base_r \<subseteq> \<Union> C

goal (1 subgoal):
 1. asym_factor base_r \<subseteq> asym_factor (\<Union> C)
[PROOF STEP]
using extends_r_unfolded
[PROOF STATE]
proof (prove)
using this:
base_r \<subseteq> \<Union> C
?r \<in> C \<Longrightarrow> (base_r \<subseteq> ?r \<and> asym_factor base_r \<subseteq> asym_factor ?r) \<and> sym_factor ?r \<subseteq> (sym_factor base_r)\<^sup>=

goal (1 subgoal):
 1. asym_factor base_r \<subseteq> asym_factor (\<Union> C)
[PROOF STEP]
unfolding asym_factor_def
[PROOF STATE]
proof (prove)
using this:
base_r \<subseteq> \<Union> C
?r \<in> C \<Longrightarrow> (base_r \<subseteq> ?r \<and> {(x, y). (x, y) \<in> base_r \<and> (y, x) \<notin> base_r} \<subseteq> {(x, y). (x, y) \<in> ?r \<and> (y, x) \<notin> ?r}) \<and> sym_factor ?r \<subseteq> (sym_factor base_r)\<^sup>=

goal (1 subgoal):
 1. {(x, y). (x, y) \<in> base_r \<and> (y, x) \<notin> base_r} \<subseteq> {(x, y). (x, y) \<in> \<Union> C \<and> (y, x) \<notin> \<Union> C}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
asym_factor base_r \<subseteq> asym_factor (\<Union> C)

goal (1 subgoal):
 1. sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=
[PROOF STEP]
show "sym_factor (\<Union>C) \<subseteq> (sym_factor base_r)\<^sup>="
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=
[PROOF STEP]
proof(safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor base_r\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor base_r\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
assume "(x, y) \<in> sym_factor (\<Union>C)" "(x, y) \<notin> sym_factor base_r"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> sym_factor (\<Union> C)
(x, y) \<notin> sym_factor base_r

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor base_r\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> sym_factor (\<Union> C)
(x, y) \<notin> sym_factor base_r
[PROOF STEP]
have "(x, y) \<in> \<Union>C" "(y, x) \<in> \<Union>C"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> sym_factor (\<Union> C)
(x, y) \<notin> sym_factor base_r

goal (1 subgoal):
 1. (x, y) \<in> \<Union> C &&& (y, x) \<in> \<Union> C
[PROOF STEP]
unfolding sym_factor_def
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> {(x, y). (x, y) \<in> \<Union> C \<and> (y, x) \<in> \<Union> C}
(x, y) \<notin> {(x, y). (x, y) \<in> base_r \<and> (y, x) \<in> base_r}

goal (1 subgoal):
 1. (x, y) \<in> \<Union> C &&& (y, x) \<in> \<Union> C
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(x, y) \<in> \<Union> C
(y, x) \<in> \<Union> C

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor base_r\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
with extends_r
[PROOF STATE]
proof (chain)
picking this:
?r \<in> C \<Longrightarrow> strict_extends ?r base_r
(x, y) \<in> \<Union> C
(y, x) \<in> \<Union> C
[PROOF STEP]
obtain c where "c \<in> C" "(x, y) \<in> c" "(y, x) \<in> c"
            "strict_extends c base_r"
[PROOF STATE]
proof (prove)
using this:
?r \<in> C \<Longrightarrow> strict_extends ?r base_r
(x, y) \<in> \<Union> C
(y, x) \<in> \<Union> C

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<in> C; (x, y) \<in> c; (y, x) \<in> c; strict_extends c base_r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using total_subs_C
[PROOF STATE]
proof (prove)
using this:
?r \<in> C \<Longrightarrow> strict_extends ?r base_r
(x, y) \<in> \<Union> C
(y, x) \<in> \<Union> C
\<lbrakk>?r \<in> C; ?s \<in> C\<rbrakk> \<Longrightarrow> ?r \<subseteq> ?s \<or> ?s \<subseteq> ?r

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<in> C; (x, y) \<in> c; (y, x) \<in> c; strict_extends c base_r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c \<in> C
(x, y) \<in> c
(y, x) \<in> c
strict_extends c base_r

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor base_r\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> C
(x, y) \<in> c
(y, x) \<in> c
strict_extends c base_r
[PROOF STEP]
have "(x, y) \<in> sym_factor c"
[PROOF STATE]
proof (prove)
using this:
c \<in> C
(x, y) \<in> c
(y, x) \<in> c
strict_extends c base_r

goal (1 subgoal):
 1. (x, y) \<in> sym_factor c
[PROOF STEP]
unfolding sym_factor_def
[PROOF STATE]
proof (prove)
using this:
c \<in> C
(x, y) \<in> c
(y, x) \<in> c
strict_extends c base_r

goal (1 subgoal):
 1. (x, y) \<in> {(x, y). (x, y) \<in> c \<and> (y, x) \<in> c}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x, y) \<in> sym_factor c

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor base_r\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
with \<open>strict_extends c base_r\<close> \<open>(x, y) \<notin> sym_factor base_r\<close>
[PROOF STATE]
proof (chain)
picking this:
strict_extends c base_r
(x, y) \<notin> sym_factor base_r
(x, y) \<in> sym_factor c
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
strict_extends c base_r
(x, y) \<notin> sym_factor base_r
(x, y) \<in> sym_factor c

goal (1 subgoal):
 1. x = y
[PROOF STEP]
unfolding strict_extends_def
[PROOF STATE]
proof (prove)
using this:
extends c base_r \<and> sym_factor c \<subseteq> (sym_factor base_r)\<^sup>=
(x, y) \<notin> sym_factor base_r
(x, y) \<in> sym_factor c

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
strict_extends (\<Union> C) base_r

goal (2 subgoals):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
 2. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
from preorder_UnC strict_extends_UnC
[PROOF STATE]
proof (chain)
picking this:
preorder_on A (\<Union> C)
strict_extends (\<Union> C) base_r
[PROOF STEP]
show "(\<Union>C) \<in> Field order_of_orders"
[PROOF STATE]
proof (prove)
using this:
preorder_on A (\<Union> C)
strict_extends (\<Union> C) base_r

goal (1 subgoal):
 1. \<Union> C \<in> Field order_of_orders
[PROOF STEP]
unfolding Field_order_of_orders
[PROOF STATE]
proof (prove)
using this:
preorder_on A (\<Union> C)
strict_extends (\<Union> C) base_r

goal (1 subgoal):
 1. \<Union> C \<in> {r. preorder_on A r \<and> strict_extends r base_r}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> C \<in> Field order_of_orders

goal (1 subgoal):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
[PROOF STEP]
text \<open>
        Lastly, we prove by contradiction that \<^term>\<open>\<Union>C\<close> is an upper bound for the chain.
      \<close>
[PROOF STATE]
proof (state)
this:
\<Union> C \<in> Field order_of_orders

goal (1 subgoal):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
[PROOF STEP]
show "\<forall>a \<in> C. (a, \<Union>C) \<in> order_of_orders"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
presume "\<exists>a \<in> C. (a, \<Union>C) \<notin> order_of_orders"
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>C. (a, \<Union> C) \<notin> order_of_orders

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a\<in>C. (a, \<Union> C) \<notin> order_of_orders
[PROOF STEP]
obtain m where m: "m \<in> C" "(m, \<Union>C) \<notin> order_of_orders"
[PROOF STATE]
proof (prove)
using this:
\<exists>a\<in>C. (a, \<Union> C) \<notin> order_of_orders

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m \<in> C; (m, \<Union> C) \<notin> order_of_orders\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
hence strict_extends_m: "strict_extends m base_r" "preorder_on A m"
[PROOF STATE]
proof (prove)
using this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders

goal (1 subgoal):
 1. strict_extends m base_r &&& preorder_on A m
[PROOF STEP]
using extends_r preorder_r
[PROOF STATE]
proof (prove)
using this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders
?r \<in> C \<Longrightarrow> strict_extends ?r base_r
?r \<in> C \<Longrightarrow> preorder_on A ?r

goal (1 subgoal):
 1. strict_extends m base_r &&& preorder_on A m
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
strict_extends m base_r
preorder_on A m

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
with m
[PROOF STATE]
proof (chain)
picking this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders
strict_extends m base_r
preorder_on A m
[PROOF STEP]
have "\<not> strict_extends (\<Union>C) m"
[PROOF STATE]
proof (prove)
using this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders
strict_extends m base_r
preorder_on A m

goal (1 subgoal):
 1. \<not> strict_extends (\<Union> C) m
[PROOF STEP]
using preorder_UnC
[PROOF STATE]
proof (prove)
using this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders
strict_extends m base_r
preorder_on A m
preorder_on A (\<Union> C)

goal (1 subgoal):
 1. \<not> strict_extends (\<Union> C) m
[PROOF STEP]
unfolding order_of_orders_def
[PROOF STATE]
proof (prove)
using this:
m \<in> C
(m, \<Union> C) \<notin> Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A))
strict_extends m base_r
preorder_on A m
preorder_on A (\<Union> C)

goal (1 subgoal):
 1. \<not> strict_extends (\<Union> C) m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> strict_extends (\<Union> C) m

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders
[PROOF STEP]
have "m \<subseteq> \<Union>C"
[PROOF STATE]
proof (prove)
using this:
m \<in> C
(m, \<Union> C) \<notin> order_of_orders

goal (1 subgoal):
 1. m \<subseteq> \<Union> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m \<subseteq> \<Union> C

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m \<subseteq> \<Union> C

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
have "sym_factor (\<Union>C) \<subseteq> (sym_factor m)\<^sup>="
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=
[PROOF STEP]
proof(safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor m\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor m\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
assume "(a, b) \<in> sym_factor (\<Union> C)" "(a, b) \<notin> sym_factor m"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> sym_factor (\<Union> C)
(a, b) \<notin> sym_factor m

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor m\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> sym_factor (\<Union> C)
(a, b) \<notin> sym_factor m
[PROOF STEP]
have "(a, b) \<in> sym_factor base_r \<or> (a, b) \<in> Id"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> sym_factor (\<Union> C)
(a, b) \<notin> sym_factor m

goal (1 subgoal):
 1. (a, b) \<in> sym_factor base_r \<or> (a, b) \<in> Id
[PROOF STEP]
using strict_extends_UnC[unfolded strict_extends_def]
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> sym_factor (\<Union> C)
(a, b) \<notin> sym_factor m
extends (\<Union> C) base_r \<and> sym_factor (\<Union> C) \<subseteq> (sym_factor base_r)\<^sup>=

goal (1 subgoal):
 1. (a, b) \<in> sym_factor base_r \<or> (a, b) \<in> Id
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a, b) \<in> sym_factor base_r \<or> (a, b) \<in> Id

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> sym_factor (\<Union> C); (a, b) \<notin> sym_factor m\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
with \<open>(a, b) \<notin> sym_factor m\<close> strict_extends_m(1)
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<notin> sym_factor m
strict_extends m base_r
(a, b) \<in> sym_factor base_r \<or> (a, b) \<in> Id
[PROOF STEP]
show "a = b"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<notin> sym_factor m
strict_extends m base_r
(a, b) \<in> sym_factor base_r \<or> (a, b) \<in> Id

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (auto elim: strict_extendsE simp: sym_factor_mono[THEN in_mono])
[PROOF STATE]
proof (state)
this:
a = b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m \<subseteq> \<Union> C
sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=
[PROOF STEP]
have "\<not> asym_factor m \<subseteq> asym_factor (\<Union>C)"
[PROOF STATE]
proof (prove)
using this:
m \<subseteq> \<Union> C
sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=

goal (1 subgoal):
 1. \<not> asym_factor m \<subseteq> asym_factor (\<Union> C)
[PROOF STEP]
using \<open>\<not> strict_extends (\<Union>C) m\<close>
[PROOF STATE]
proof (prove)
using this:
m \<subseteq> \<Union> C
sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=
\<not> strict_extends (\<Union> C) m

goal (1 subgoal):
 1. \<not> asym_factor m \<subseteq> asym_factor (\<Union> C)
[PROOF STEP]
unfolding strict_extends_def extends_def
[PROOF STATE]
proof (prove)
using this:
m \<subseteq> \<Union> C
sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=
\<not> ((m \<subseteq> \<Union> C \<and> asym_factor m \<subseteq> asym_factor (\<Union> C)) \<and> sym_factor (\<Union> C) \<subseteq> (sym_factor m)\<^sup>=)

goal (1 subgoal):
 1. \<not> asym_factor m \<subseteq> asym_factor (\<Union> C)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> asym_factor m \<subseteq> asym_factor (\<Union> C)

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> asym_factor m \<subseteq> asym_factor (\<Union> C)
[PROOF STEP]
obtain x y where
          "(x, y) \<in> m" "(y, x) \<notin> m" "(x, y) \<in> asym_factor m" "(x, y) \<notin> asym_factor (\<Union>C)"
[PROOF STATE]
proof (prove)
using this:
\<not> asym_factor m \<subseteq> asym_factor (\<Union> C)

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>(x, y) \<in> m; (y, x) \<notin> m; (x, y) \<in> asym_factor m; (x, y) \<notin> asym_factor (\<Union> C)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding asym_factor_def
[PROOF STATE]
proof (prove)
using this:
\<not> {(x, y). (x, y) \<in> m \<and> (y, x) \<notin> m} \<subseteq> {(x, y). (x, y) \<in> \<Union> C \<and> (y, x) \<notin> \<Union> C}

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>(x, y) \<in> m; (y, x) \<notin> m; (x, y) \<in> {(x, y). (x, y) \<in> m \<and> (y, x) \<notin> m}; (x, y) \<notin> {(x, y). (x, y) \<in> \<Union> C \<and> (y, x) \<notin> \<Union> C}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x, y) \<in> m
(y, x) \<notin> m
(x, y) \<in> asym_factor m
(x, y) \<notin> asym_factor (\<Union> C)

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> m
(y, x) \<notin> m
(x, y) \<in> asym_factor m
(x, y) \<notin> asym_factor (\<Union> C)
[PROOF STEP]
obtain w where "w \<in> C" "(y, x) \<in> w"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> m
(y, x) \<notin> m
(x, y) \<in> asym_factor m
(x, y) \<notin> asym_factor (\<Union> C)

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> C; (y, x) \<in> w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding asym_factor_def
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> m
(y, x) \<notin> m
(x, y) \<in> {(x, y). (x, y) \<in> m \<and> (y, x) \<notin> m}
(x, y) \<notin> {(x, y). (x, y) \<in> \<Union> C \<and> (y, x) \<notin> \<Union> C}

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> C; (y, x) \<in> w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>m \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> m
(y, x) \<notin> m
(x, y) \<in> {(x, y). (x, y) \<in> m \<and> (y, x) \<notin> m}
(x, y) \<notin> {(x, y). (x, y) \<in> \<Union> C \<and> (y, x) \<notin> \<Union> C}
m \<in> C

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> C; (y, x) \<in> w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> C
(y, x) \<in> w

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
with \<open>(y, x) \<notin> m\<close>
[PROOF STATE]
proof (chain)
picking this:
(y, x) \<notin> m
w \<in> C
(y, x) \<in> w
[PROOF STEP]
have "\<not> extends m w"
[PROOF STATE]
proof (prove)
using this:
(y, x) \<notin> m
w \<in> C
(y, x) \<in> w

goal (1 subgoal):
 1. \<not> extends m w
[PROOF STEP]
unfolding extends_def
[PROOF STATE]
proof (prove)
using this:
(y, x) \<notin> m
w \<in> C
(y, x) \<in> w

goal (1 subgoal):
 1. \<not> (w \<subseteq> m \<and> asym_factor w \<subseteq> asym_factor m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> extends m w

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> extends m w

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
from \<open>(x, y) \<in> m\<close>
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> m
[PROOF STEP]
have "\<not> extends w m"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> m

goal (1 subgoal):
 1. \<not> extends w m
[PROOF STEP]
proof(cases "(x, y) \<in> w")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(x, y) \<in> m; (x, y) \<in> w\<rbrakk> \<Longrightarrow> \<not> extends w m
 2. \<lbrakk>(x, y) \<in> m; (x, y) \<notin> w\<rbrakk> \<Longrightarrow> \<not> extends w m
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(x, y) \<in> w

goal (2 subgoals):
 1. \<lbrakk>(x, y) \<in> m; (x, y) \<in> w\<rbrakk> \<Longrightarrow> \<not> extends w m
 2. \<lbrakk>(x, y) \<in> m; (x, y) \<notin> w\<rbrakk> \<Longrightarrow> \<not> extends w m
[PROOF STEP]
with \<open>(y, x) \<in> w\<close>
[PROOF STATE]
proof (chain)
picking this:
(y, x) \<in> w
(x, y) \<in> w
[PROOF STEP]
have "(x, y) \<notin> asym_factor w"
[PROOF STATE]
proof (prove)
using this:
(y, x) \<in> w
(x, y) \<in> w

goal (1 subgoal):
 1. (x, y) \<notin> asym_factor w
[PROOF STEP]
unfolding asym_factor_def
[PROOF STATE]
proof (prove)
using this:
(y, x) \<in> w
(x, y) \<in> w

goal (1 subgoal):
 1. (x, y) \<notin> {(x, y). (x, y) \<in> w \<and> (y, x) \<notin> w}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x, y) \<notin> asym_factor w

goal (2 subgoals):
 1. \<lbrakk>(x, y) \<in> m; (x, y) \<in> w\<rbrakk> \<Longrightarrow> \<not> extends w m
 2. \<lbrakk>(x, y) \<in> m; (x, y) \<notin> w\<rbrakk> \<Longrightarrow> \<not> extends w m
[PROOF STEP]
with \<open>(x, y) \<in> asym_factor m\<close>
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> asym_factor m
(x, y) \<notin> asym_factor w
[PROOF STEP]
show "\<not> extends w m"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> asym_factor m
(x, y) \<notin> asym_factor w

goal (1 subgoal):
 1. \<not> extends w m
[PROOF STEP]
unfolding extends_def
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> asym_factor m
(x, y) \<notin> asym_factor w

goal (1 subgoal):
 1. \<not> (m \<subseteq> w \<and> asym_factor m \<subseteq> asym_factor w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> extends w m

goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> m; (x, y) \<notin> w\<rbrakk> \<Longrightarrow> \<not> extends w m
[PROOF STEP]
qed (auto simp: extends_def)
[PROOF STATE]
proof (state)
this:
\<not> extends w m

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> extends m w
\<not> extends w m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> extends m w
\<not> extends w m

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>m \<in> C\<close> \<open>w \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> extends m w
\<not> extends w m
m \<in> C
w \<in> C

goal (1 subgoal):
 1. False
[PROOF STEP]
using C_def[unfolded Chains_def order_of_orders_def strict_extends_def]
[PROOF STATE]
proof (prove)
using this:
\<not> extends m w
\<not> extends w m
m \<in> C
w \<in> C
C \<in> {C. \<forall>a\<in>C. \<forall>b\<in>C. (a, b) \<in> Restr {(r, s). (extends r base_r \<and> sym_factor r \<subseteq> (sym_factor base_r)\<^sup>=) \<and> extends s r \<and> sym_factor s \<subseteq> (sym_factor r)\<^sup>=} (Collect (preorder_on A)) \<or> (b, a) \<in> Restr {(r, s). (extends r base_r \<and> sym_factor r \<subseteq> (sym_factor base_r)\<^sup>=) \<and> extends s r \<and> sym_factor s \<subseteq> (sym_factor r)\<^sup>=} (Collect (preorder_on A))}

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders) \<Longrightarrow> \<exists>a\<in>C. (a, \<Union> C) \<notin> order_of_orders
[PROOF STEP]
qed blast
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>C. (a, \<Union> C) \<in> order_of_orders

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?C \<in> Chains order_of_orders; ?C \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>u\<in>Field order_of_orders. \<forall>a\<in>?C. (a, u) \<in> order_of_orders

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>m\<in>Field order_of_orders. \<forall>a\<in>Field order_of_orders. (m, a) \<in> order_of_orders \<longrightarrow> a = m

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
text \<open>Let our maximal element be named \<^term>\<open>max\<close>:\<close>
[PROOF STATE]
proof (state)
this:
\<exists>m\<in>Field order_of_orders. \<forall>a\<in>Field order_of_orders. (m, a) \<in> order_of_orders \<longrightarrow> a = m

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>m\<in>Field order_of_orders. \<forall>a\<in>Field order_of_orders. (m, a) \<in> order_of_orders \<longrightarrow> a = m
[PROOF STEP]
obtain max
    where max_field: "max \<in> Field order_of_orders"
      and is_max:
        "\<forall>a\<in>Field order_of_orders. (max, a) \<in> order_of_orders \<longrightarrow> a = max"
[PROOF STATE]
proof (prove)
using this:
\<exists>m\<in>Field order_of_orders. \<forall>a\<in>Field order_of_orders. (m, a) \<in> order_of_orders \<longrightarrow> a = m

goal (1 subgoal):
 1. (\<And>max. \<lbrakk>max \<in> Field order_of_orders; \<forall>a\<in>Field order_of_orders. (max, a) \<in> order_of_orders \<longrightarrow> a = max\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max \<in> Field order_of_orders
\<forall>a\<in>Field order_of_orders. (max, a) \<in> order_of_orders \<longrightarrow> a = max

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
from max_field
[PROOF STATE]
proof (chain)
picking this:
max \<in> Field order_of_orders
[PROOF STEP]
have max_extends_base: "preorder_on A max" "strict_extends max base_r"
[PROOF STATE]
proof (prove)
using this:
max \<in> Field order_of_orders

goal (1 subgoal):
 1. preorder_on A max &&& strict_extends max base_r
[PROOF STEP]
using Field_order_of_orders
[PROOF STATE]
proof (prove)
using this:
max \<in> Field order_of_orders
Field order_of_orders = {r. preorder_on A r \<and> strict_extends r base_r}

goal (1 subgoal):
 1. preorder_on A max &&& strict_extends max base_r
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
preorder_on A max
strict_extends max base_r

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
text \<open>
    We still have to show, that \<^term>\<open>max\<close> is a strict linear order,
    meaning that it is also a total order:
  \<close>
[PROOF STATE]
proof (state)
this:
preorder_on A max
strict_extends max base_r

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
have "total_on A max"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_on A max
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> (x, y) \<in> max \<or> (y, x) \<in> max
[PROOF STEP]
fix x y :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> (x, y) \<in> max \<or> (y, x) \<in> max
[PROOF STEP]
assume "x \<noteq> y" "x \<in> A" "y \<in> A"
[PROOF STATE]
proof (state)
this:
x \<noteq> y
x \<in> A
y \<in> A

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; x \<noteq> y\<rbrakk> \<Longrightarrow> (x, y) \<in> max \<or> (y, x) \<in> max
[PROOF STEP]
show "(x, y) \<in> max \<or> (y, x) \<in> max"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> max \<or> (y, x) \<in> max
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
text \<open>
        Assume that \<^term>\<open>max\<close> is not total, and \<^term>\<open>x\<close> and \<^term>\<open>y\<close> are incomparable.
        Then we can extend \<^term>\<open>max\<close> by setting $x < y$:
      \<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
presume "(x, y) \<notin> max" and "(y, x) \<notin> max"
[PROOF STATE]
proof (state)
this:
(x, y) \<notin> max
(y, x) \<notin> max

goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
let ?max' = "(insert (x, y) max)\<^sup>+"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
note max'_extends_max = can_extend_preorder[OF
          \<open>preorder_on A max\<close> \<open>y \<in> A\<close> \<open>x \<in> A\<close> \<open>(y, x) \<notin> max\<close>]
[PROOF STATE]
proof (state)
this:
preorder_on A ((insert (x, y) max)\<^sup>+)
strict_extends ((insert (x, y) max)\<^sup>+) max

goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
hence max'_extends_base: "strict_extends ?max' base_r"
[PROOF STATE]
proof (prove)
using this:
preorder_on A ((insert (x, y) max)\<^sup>+)
strict_extends ((insert (x, y) max)\<^sup>+) max

goal (1 subgoal):
 1. strict_extends ((insert (x, y) max)\<^sup>+) base_r
[PROOF STEP]
using \<open>strict_extends max base_r\<close> transp_strict_extends
[PROOF STATE]
proof (prove)
using this:
preorder_on A ((insert (x, y) max)\<^sup>+)
strict_extends ((insert (x, y) max)\<^sup>+) max
strict_extends max base_r
transp strict_extends

goal (1 subgoal):
 1. strict_extends ((insert (x, y) max)\<^sup>+) base_r
[PROOF STEP]
by (auto elim: transpE)
[PROOF STATE]
proof (state)
this:
strict_extends ((insert (x, y) max)\<^sup>+) base_r

goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
text \<open>The extended relation is greater than \<^term>\<open>max\<close>, which is a contradiction.\<close>
[PROOF STATE]
proof (state)
this:
strict_extends ((insert (x, y) max)\<^sup>+) base_r

goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
have "(max, ?max') \<in> order_of_orders"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (max, (insert (x, y) max)\<^sup>+) \<in> order_of_orders
[PROOF STEP]
using max'_extends_base max'_extends_max max_extends_base
[PROOF STATE]
proof (prove)
using this:
strict_extends ((insert (x, y) max)\<^sup>+) base_r
preorder_on A ((insert (x, y) max)\<^sup>+)
strict_extends ((insert (x, y) max)\<^sup>+) max
preorder_on A max
strict_extends max base_r

goal (1 subgoal):
 1. (max, (insert (x, y) max)\<^sup>+) \<in> order_of_orders
[PROOF STEP]
unfolding order_of_orders_def
[PROOF STATE]
proof (prove)
using this:
strict_extends ((insert (x, y) max)\<^sup>+) base_r
preorder_on A ((insert (x, y) max)\<^sup>+)
strict_extends ((insert (x, y) max)\<^sup>+) max
preorder_on A max
strict_extends max base_r

goal (1 subgoal):
 1. (max, (insert (x, y) max)\<^sup>+) \<in> Restr {(r, s). strict_extends r base_r \<and> strict_extends s r} (Collect (preorder_on A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(max, (insert (x, y) max)\<^sup>+) \<in> order_of_orders

goal (1 subgoal):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
(max, (insert (x, y) max)\<^sup>+) \<in> order_of_orders

goal (1 subgoal):
 1. False
[PROOF STEP]
using FieldI2 \<open>(x, y) \<notin> max\<close> is_max
[PROOF STATE]
proof (prove)
using this:
(max, (insert (x, y) max)\<^sup>+) \<in> order_of_orders
(?i, ?j) \<in> ?R \<Longrightarrow> ?j \<in> Field ?R
(x, y) \<notin> max
\<forall>a\<in>Field order_of_orders. (max, a) \<in> order_of_orders \<longrightarrow> a = max

goal (1 subgoal):
 1. False
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
False

goal (2 subgoals):
 1. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> (x, y) \<notin> max
 2. \<not> ((x, y) \<in> max \<or> (y, x) \<in> max) \<Longrightarrow> (y, x) \<notin> max
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
(x, y) \<in> max \<or> (y, x) \<in> max

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
total_on A max

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
with \<open>preorder_on A max\<close>
[PROOF STATE]
proof (chain)
picking this:
preorder_on A max
total_on A max
[PROOF STEP]
have "total_preorder_on A max"
[PROOF STATE]
proof (prove)
using this:
preorder_on A max
total_on A max

goal (1 subgoal):
 1. total_preorder_on A max
[PROOF STEP]
unfolding total_preorder_on_def
[PROOF STATE]
proof (prove)
using this:
preorder_on A max
total_on A max

goal (1 subgoal):
 1. preorder_on A max \<and> total_on A max
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
total_preorder_on A max

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
with \<open>strict_extends max base_r\<close>
[PROOF STATE]
proof (chain)
picking this:
strict_extends max base_r
total_preorder_on A max
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
using this:
strict_extends max base_r
total_preorder_on A max

goal (1 subgoal):
 1. \<exists>r. total_preorder_on A r \<and> strict_extends r base_r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>r. total_preorder_on A r \<and> strict_extends r base_r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_segment_image_interval:
     "open_segment a b = (if a=b then {} else (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_segment a b = (if a = b then {} else (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1})
[PROOF STEP]
by (auto simp:  open_segment_def closed_segment_def segment_degen_0 segment_degen_1)


[STATEMENT]
lemma arsinh_real_at_top:
  "filterlim (arsinh :: real \<Rightarrow> real) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim arsinh at_top at_top
[PROOF STEP]
proof (subst filterlim_cong[OF refl refl])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_top. arsinh x = ?g x
 2. filterlim ?g at_top at_top
[PROOF STEP]
show "filterlim (\<lambda>x. ln (x + sqrt (1 + x\<^sup>2))) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. ln (x + sqrt (1 + x\<^sup>2)) :> at_top
[PROOF STEP]
by (intro filterlim_compose[OF ln_at_top filterlim_at_top_add_at_top] filterlim_ident
              filterlim_compose[OF sqrt_at_top] filterlim_tendsto_add_at_top[OF tendsto_const]
              filterlim_pow_at_top) auto
[PROOF STATE]
proof (state)
this:
LIM x at_top. ln (x + sqrt (1 + x\<^sup>2)) :> at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. arsinh x = ln (x + sqrt (1 + x\<^sup>2))
[PROOF STEP]
qed (auto intro!: eventually_mono[OF eventually_ge_at_top[of 1]] simp: arsinh_real_def add_ac)


[STATEMENT]
lemma iso_iff_mon_epi: "f \<in> iso G H \<longleftrightarrow> f \<in> mon G H \<and> f \<in> epi G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> Group.iso G H) = (f \<in> mon G H \<and> f \<in> epi G H)
[PROOF STEP]
by (auto simp: iso_def mon_def epi_def bij_betw_def)


[STATEMENT]
lemma asymp_equiv_at_top_imp_at_0:
  "(\<lambda>x. f (-inverse x)) \<sim>[at_top] (\<lambda>x. g (-inverse x)) \<Longrightarrow>
   (\<lambda>x. f (inverse x)) \<sim>[at_top] (\<lambda>x. g (inverse x)) \<Longrightarrow> f \<sim>[at 0] g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>x. f (- inverse x)) \<sim>[at_top] (\<lambda>x. g (- inverse x)); (\<lambda>x. f (inverse x)) \<sim>[at_top] (\<lambda>x. g (inverse x))\<rbrakk> \<Longrightarrow> f \<sim>[at 0] g
[PROOF STEP]
by (rule asymp_equiv_at_top_imp_at) auto


[STATEMENT]
lemma module_hom_add: "\<lbrakk>f\<in> module_hom R M N; m1\<in>carrier M; m2\<in>carrier M \<rbrakk> \<Longrightarrow> f (m1 \<oplus>\<^bsub>M\<^esub> m2) = (f m1) \<oplus>\<^bsub>N\<^esub> (f m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> module_hom R M N; m1 \<in> carrier M; m2 \<in> carrier M\<rbrakk> \<Longrightarrow> f (m1 \<oplus>\<^bsub>M\<^esub> m2) = f m1 \<oplus>\<^bsub>N\<^esub> f m2
[PROOF STEP]
by (unfold module_hom_def, auto)


[STATEMENT]
lemma algebraic_power_iff [simp]:
  assumes "n > 0"
  shows   "algebraic (x ^ n) \<longleftrightarrow> algebraic x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic (x ^ n) = algebraic x
[PROOF STEP]
using algebraic_nth_root[of n "x ^ n" x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n \<noteq> 0; algebraic (x ^ n); x ^ n = x ^ n\<rbrakk> \<Longrightarrow> algebraic x
0 < n

goal (1 subgoal):
 1. algebraic (x ^ n) = algebraic x
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_fun_sum:
  fixes f g :: "'a \<Rightarrow> 'b::join_semilattice_zero"
  assumes  "finite (A :: 'a set)"
  shows "\<Sum>((\<lambda>x. f x + g x) ` A) = \<Sum>(f ` A) + \<Sum>(g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
fix z:: 'b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
have "\<Sum>((\<lambda>x. f x + g x) ` A) \<le> z \<longleftrightarrow> \<Sum>(f ` A) + \<Sum>(g ` A) \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum> ((\<lambda>x. f x + g x) ` A) \<le> z) = (\<Sum> (f ` A) + \<Sum> (g ` A) \<le> z)
[PROOF STEP]
by (auto simp add: assms sum_fun_image_sup)
[PROOF STATE]
proof (state)
this:
(\<Sum> ((\<lambda>x. f x + g x) ` A) \<le> z) = (\<Sum> (f ` A) + \<Sum> (g ` A) \<le> z)

goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<Sum> ((\<lambda>x. f x + g x) ` A) \<le> ?z2) = (\<Sum> (f ` A) + \<Sum> (g ` A) \<le> ?z2)

goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum> ((\<lambda>x. f x + g x) ` A) \<le> ?z2) = (\<Sum> (f ` A) + \<Sum> (g ` A) \<le> ?z2)

goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)
[PROOF STEP]
by (simp add: eq_iff)
[PROOF STATE]
proof (state)
this:
\<Sum> ((\<lambda>x. f x + g x) ` A) = \<Sum> (f ` A) + \<Sum> (g ` A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_sgn: "norm (sgn x) = (if x = 0 then 0 else 1)"
  for x :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (sgn x) = (if x = (0::'a) then 0 else 1)
[PROOF STEP]
by (simp add: sgn_div_norm)


[STATEMENT]
lemma homeomorphic_connectedness:
  assumes "s homeomorphic t"
  shows "connected s \<longleftrightarrow> connected t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected s = connected t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s homeomorphic t

goal (1 subgoal):
 1. connected s = connected t
[PROOF STEP]
unfolding homeomorphic_def homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f g. (\<forall>x\<in>s. g (f x) = x) \<and> f ` s = t \<and> continuous_on s f \<and> (\<forall>y\<in>t. f (g y) = y) \<and> g ` t = s \<and> continuous_on t g

goal (1 subgoal):
 1. connected s = connected t
[PROOF STEP]
by (metis connected_continuous_image)


[STATEMENT]
lemma unitary_between_unitary:
  fixes E F :: \<open>'a::chilbert_space set\<close>
  assumes \<open>is_onb E\<close> \<open>is_onb F\<close>
  shows \<open>unitary (unitary_between E F)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
have \<open>(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c\<close> if \<open>b \<in> E\<close> and \<open>c \<in> E\<close> for b c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
proof (cases \<open>b = c\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b = c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
 2. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b = c

goal (2 subgoals):
 1. b = c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
 2. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from \<open>is_onb E\<close> that
[PROOF STATE]
proof (chain)
picking this:
is_onb E
b \<in> E
c \<in> E
[PROOF STEP]
have 1: \<open>b \<bullet>\<^sub>C b = 1\<close>
[PROOF STATE]
proof (prove)
using this:
is_onb E
b \<in> E
c \<in> E

goal (1 subgoal):
 1. b \<bullet>\<^sub>C b = 1
[PROOF STEP]
using cnorm_eq_1 is_onb_def
[PROOF STATE]
proof (prove)
using this:
is_onb E
b \<in> E
c \<in> E
(norm ?x = 1) = (?x \<bullet>\<^sub>C ?x = 1)
is_onb ?E = (is_ortho_set ?E \<and> (\<forall>b\<in>?E. norm b = 1) \<and> ccspan ?E = \<top>)

goal (1 subgoal):
 1. b \<bullet>\<^sub>C b = 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<bullet>\<^sub>C b = 1

goal (2 subgoals):
 1. b = c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
 2. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
b \<in> E
c \<in> E
[PROOF STEP]
have \<open>unitary_between E F *\<^sub>V b \<in> F\<close>
[PROOF STATE]
proof (prove)
using this:
b \<in> E
c \<in> E

goal (1 subgoal):
 1. unitary_between E F *\<^sub>V b \<in> F
[PROOF STEP]
by (metis assms(1) assms(2) bij_betw_apply bij_between_bases_bij unitary_between_apply)
[PROOF STATE]
proof (state)
this:
unitary_between E F *\<^sub>V b \<in> F

goal (2 subgoals):
 1. b = c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
 2. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
with \<open>is_onb F\<close>
[PROOF STATE]
proof (chain)
picking this:
is_onb F
unitary_between E F *\<^sub>V b \<in> F
[PROOF STEP]
have 2: \<open>(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V b) = 1\<close>
[PROOF STATE]
proof (prove)
using this:
is_onb F
unitary_between E F *\<^sub>V b \<in> F

goal (1 subgoal):
 1. (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V b) = 1
[PROOF STEP]
by (simp add: cnorm_eq_1 is_onb_def)
[PROOF STATE]
proof (state)
this:
(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V b) = 1

goal (2 subgoals):
 1. b = c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
 2. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from 1 2 True
[PROOF STATE]
proof (chain)
picking this:
b \<bullet>\<^sub>C b = 1
(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V b) = 1
b = c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<bullet>\<^sub>C b = 1
(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V b) = 1
b = c

goal (1 subgoal):
 1. (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c

goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
b \<noteq> c

goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from \<open>is_onb E\<close> that
[PROOF STATE]
proof (chain)
picking this:
is_onb E
b \<in> E
c \<in> E
[PROOF STEP]
have 1: \<open>b \<bullet>\<^sub>C c = 0\<close>
[PROOF STATE]
proof (prove)
using this:
is_onb E
b \<in> E
c \<in> E

goal (1 subgoal):
 1. is_orthogonal b c
[PROOF STEP]
by (simp add: False is_onb_def is_ortho_set_def)
[PROOF STATE]
proof (state)
this:
is_orthogonal b c

goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
b \<in> E
c \<in> E
[PROOF STEP]
have inF: \<open>unitary_between E F *\<^sub>V b \<in> F\<close> \<open>unitary_between E F *\<^sub>V c \<in> F\<close>
[PROOF STATE]
proof (prove)
using this:
b \<in> E
c \<in> E

goal (1 subgoal):
 1. unitary_between E F *\<^sub>V b \<in> F &&& unitary_between E F *\<^sub>V c \<in> F
[PROOF STEP]
by (metis assms(1) assms(2) bij_betw_apply bij_between_bases_bij unitary_between_apply)+
[PROOF STATE]
proof (state)
this:
unitary_between E F *\<^sub>V b \<in> F
unitary_between E F *\<^sub>V c \<in> F

goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
have neq: \<open>unitary_between E F *\<^sub>V b \<noteq> unitary_between E F *\<^sub>V c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary_between E F *\<^sub>V b \<noteq> unitary_between E F *\<^sub>V c
[PROOF STEP]
by (metis (no_types, lifting) False assms(1) assms(2) bij_betw_iff_bijections bij_between_bases_bij that(1) that(2) unitary_between_apply)
[PROOF STATE]
proof (state)
this:
unitary_between E F *\<^sub>V b \<noteq> unitary_between E F *\<^sub>V c

goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from inF neq \<open>is_onb F\<close>
[PROOF STATE]
proof (chain)
picking this:
unitary_between E F *\<^sub>V b \<in> F
unitary_between E F *\<^sub>V c \<in> F
unitary_between E F *\<^sub>V b \<noteq> unitary_between E F *\<^sub>V c
is_onb F
[PROOF STEP]
have 2: \<open>(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
unitary_between E F *\<^sub>V b \<in> F
unitary_between E F *\<^sub>V c \<in> F
unitary_between E F *\<^sub>V b \<noteq> unitary_between E F *\<^sub>V c
is_onb F

goal (1 subgoal):
 1. is_orthogonal (unitary_between E F *\<^sub>V b) (unitary_between E F *\<^sub>V c)
[PROOF STEP]
by (simp add: is_onb_def is_ortho_set_def)
[PROOF STATE]
proof (state)
this:
is_orthogonal (unitary_between E F *\<^sub>V b) (unitary_between E F *\<^sub>V c)

goal (1 subgoal):
 1. b \<noteq> c \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
is_orthogonal b c
is_orthogonal (unitary_between E F *\<^sub>V b) (unitary_between E F *\<^sub>V c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_orthogonal b c
is_orthogonal (unitary_between E F *\<^sub>V b) (unitary_between E F *\<^sub>V c)

goal (1 subgoal):
 1. (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<in> E; ?c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V ?b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V ?c) = ?b \<bullet>\<^sub>C ?c

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?b \<in> E; ?c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V ?b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V ?c) = ?b \<bullet>\<^sub>C ?c
[PROOF STEP]
have iso: \<open>isometry (unitary_between E F)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<in> E; ?c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V ?b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V ?c) = ?b \<bullet>\<^sub>C ?c

goal (1 subgoal):
 1. isometry (unitary_between E F)
[PROOF STEP]
apply (rule_tac orthogonal_on_basis_is_isometry[where B=E])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>b c. \<lbrakk>b \<in> E; c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c) \<Longrightarrow> ccspan E = \<top>
 2. \<And>b c. \<lbrakk>\<And>b c. \<lbrakk>b \<in> E; c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c; b \<in> E; c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
using assms(1) is_onb_def
[PROOF STATE]
proof (prove)
using this:
is_onb E
is_onb ?E = (is_ortho_set ?E \<and> (\<forall>b\<in>?E. norm b = 1) \<and> ccspan ?E = \<top>)

goal (2 subgoals):
 1. (\<And>b c. \<lbrakk>b \<in> E; c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c) \<Longrightarrow> ccspan E = \<top>
 2. \<And>b c. \<lbrakk>\<And>b c. \<lbrakk>b \<in> E; c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c; b \<in> E; c \<in> E\<rbrakk> \<Longrightarrow> (unitary_between E F *\<^sub>V b) \<bullet>\<^sub>C (unitary_between E F *\<^sub>V c) = b \<bullet>\<^sub>C c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isometry (unitary_between E F)

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
have \<open>unitary_between E F *\<^sub>S top = unitary_between E F *\<^sub>S ccspan E\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary_between E F *\<^sub>S \<top> = unitary_between E F *\<^sub>S ccspan E
[PROOF STEP]
by (metis assms(1) is_onb_def)
[PROOF STATE]
proof (state)
this:
unitary_between E F *\<^sub>S \<top> = unitary_between E F *\<^sub>S ccspan E

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unitary_between E F *\<^sub>S \<top> = unitary_between E F *\<^sub>S ccspan E

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
have \<open>\<dots> \<ge> ccspan (unitary_between E F ` E)\<close> (is \<open>_ \<ge> \<dots>\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan ((*\<^sub>V) (unitary_between E F) ` E) \<le> unitary_between E F *\<^sub>S ccspan E
[PROOF STEP]
by (simp add: cblinfun_image_ccspan)
[PROOF STATE]
proof (state)
this:
ccspan ((*\<^sub>V) (unitary_between E F) ` E) \<le> unitary_between E F *\<^sub>S ccspan E

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccspan ((*\<^sub>V) (unitary_between E F) ` E) \<le> unitary_between E F *\<^sub>S ccspan E

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
have \<open>\<dots> = ccspan (bij_between_bases E F ` E)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan ((*\<^sub>V) (unitary_between E F) ` E) = ccspan (bij_between_bases E F ` E)
[PROOF STEP]
by (metis assms(1) assms(2) image_cong unitary_between_apply)
[PROOF STATE]
proof (state)
this:
ccspan ((*\<^sub>V) (unitary_between E F) ` E) = ccspan (bij_between_bases E F ` E)

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccspan ((*\<^sub>V) (unitary_between E F) ` E) = ccspan (bij_between_bases E F ` E)

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
have \<open>\<dots> = ccspan F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (bij_between_bases E F ` E) = ccspan F
[PROOF STEP]
by (metis assms(1) assms(2) bij_betw_imp_surj_on bij_between_bases_bij)
[PROOF STATE]
proof (state)
this:
ccspan (bij_between_bases E F ` E) = ccspan F

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccspan (bij_between_bases E F ` E) = ccspan F

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
have \<open>\<dots> = top\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan F = \<top>
[PROOF STEP]
using assms(2) is_onb_def
[PROOF STATE]
proof (prove)
using this:
is_onb F
is_onb ?E = (is_ortho_set ?E \<and> (\<forall>b\<in>?E. norm b = 1) \<and> ccspan ?E = \<top>)

goal (1 subgoal):
 1. ccspan F = \<top>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ccspan F = \<top>

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<top> \<le> unitary_between E F *\<^sub>S \<top>
[PROOF STEP]
have surj: \<open>unitary_between E F *\<^sub>S top = top\<close>
[PROOF STATE]
proof (prove)
using this:
\<top> \<le> unitary_between E F *\<^sub>S \<top>

goal (1 subgoal):
 1. unitary_between E F *\<^sub>S \<top> = \<top>
[PROOF STEP]
by (simp add: top.extremum_unique)
[PROOF STATE]
proof (state)
this:
unitary_between E F *\<^sub>S \<top> = \<top>

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
from iso surj
[PROOF STATE]
proof (chain)
picking this:
isometry (unitary_between E F)
unitary_between E F *\<^sub>S \<top> = \<top>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isometry (unitary_between E F)
unitary_between E F *\<^sub>S \<top> = \<top>

goal (1 subgoal):
 1. unitary (unitary_between E F)
[PROOF STEP]
by (rule surj_isometry_is_unitary)
[PROOF STATE]
proof (state)
this:
unitary (unitary_between E F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_linear_power: "coeff ([:a, 1:] ^ n) n = 1"
  for a :: "'a::comm_semiring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff ([:a, 1::'a:] ^ n) n = (1::'a)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. coeff ([:a, 1::'a:] ^ 0) 0 = (1::'a)
 2. \<And>n. coeff ([:a, 1::'a:] ^ n) n = (1::'a) \<Longrightarrow> coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
coeff ([:a, 1::'a:] ^ n) n = (1::'a)

goal (2 subgoals):
 1. coeff ([:a, 1::'a:] ^ 0) 0 = (1::'a)
 2. \<And>n. coeff ([:a, 1::'a:] ^ n) n = (1::'a) \<Longrightarrow> coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)
[PROOF STEP]
have "degree ([:a, 1:] ^ n) \<le> 1 * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree ([:a, 1::'a:] ^ n) \<le> 1 * n
[PROOF STEP]
by (metis One_nat_def degree_pCons_eq_if degree_power_le one_neq_zero one_pCons)
[PROOF STATE]
proof (state)
this:
degree ([:a, 1::'a:] ^ n) \<le> 1 * n

goal (2 subgoals):
 1. coeff ([:a, 1::'a:] ^ 0) 0 = (1::'a)
 2. \<And>n. coeff ([:a, 1::'a:] ^ n) n = (1::'a) \<Longrightarrow> coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree ([:a, 1::'a:] ^ n) \<le> 1 * n
[PROOF STEP]
have "coeff ([:a, 1:] ^ n) (Suc n) = 0"
[PROOF STATE]
proof (prove)
using this:
degree ([:a, 1::'a:] ^ n) \<le> 1 * n

goal (1 subgoal):
 1. coeff ([:a, 1::'a:] ^ n) (Suc n) = (0::'a)
[PROOF STEP]
by (simp add: coeff_eq_0)
[PROOF STATE]
proof (state)
this:
coeff ([:a, 1::'a:] ^ n) (Suc n) = (0::'a)

goal (2 subgoals):
 1. coeff ([:a, 1::'a:] ^ 0) 0 = (1::'a)
 2. \<And>n. coeff ([:a, 1::'a:] ^ n) n = (1::'a) \<Longrightarrow> coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coeff ([:a, 1::'a:] ^ n) (Suc n) = (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
coeff ([:a, 1::'a:] ^ n) (Suc n) = (0::'a)

goal (1 subgoal):
 1. coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)
[PROOF STEP]
using Suc.hyps
[PROOF STATE]
proof (prove)
using this:
coeff ([:a, 1::'a:] ^ n) (Suc n) = (0::'a)
coeff ([:a, 1::'a:] ^ n) n = (1::'a)

goal (1 subgoal):
 1. coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
coeff ([:a, 1::'a:] ^ Suc n) (Suc n) = (1::'a)

goal (1 subgoal):
 1. coeff ([:a, 1::'a:] ^ 0) 0 = (1::'a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma span_card_ge_dim:
  "B \<subseteq> V \<Longrightarrow> V \<subseteq> span B \<Longrightarrow> finite B \<Longrightarrow> dim V \<le> card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> V; V \<subseteq> span B; finite B\<rbrakk> \<Longrightarrow> dim V \<le> card B
[PROOF STEP]
by (simp add: dim_le_card)


[STATEMENT]
lemma image_mset_cong2:
  "(\<And>x. x \<in># M \<Longrightarrow> f x = g x) \<Longrightarrow> M = N \<Longrightarrow> image_mset f M = image_mset g N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in># M \<Longrightarrow> f x = g x; M = N\<rbrakk> \<Longrightarrow> image_mset f M = image_mset g N
[PROOF STEP]
by (hypsubst, rule image_mset_cong)


[STATEMENT]
lemma bij_betw_iteI:
  assumes "bij_betw f A B" "bij_betw g C D" "A \<inter> C = {}" "B \<inter> D = {}"
  shows "bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
have "bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B
[PROOF STEP]
by (metis bij_betw_cong[of A f "\<lambda>x. if x \<in> A then f x else g x" B] assms(1))
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B

goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B

goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
have "bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D
[PROOF STEP]
using bij_betw_cong[of C g "\<lambda>x. if x \<in> A then f x else g x" D] assms(2,3)
[PROOF STATE]
proof (prove)
using this:
(\<And>a. a \<in> C \<Longrightarrow> g a = (if a \<in> A then f a else g a)) \<Longrightarrow> bij_betw g C D = bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D
bij_betw g C D
A \<inter> C = {}

goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D

goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B
bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B
bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D

goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
using bij_betw_combine[OF _ _ assms(4)]
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) A B
bij_betw (\<lambda>x. if x \<in> A then f x else g x) C D
\<lbrakk>bij_betw ?f ?A B; bij_betw ?f ?C D\<rbrakk> \<Longrightarrow> bij_betw ?f (?A \<union> ?C) (B \<union> D)

goal (1 subgoal):
 1. bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>x. if x \<in> A then f x else g x) (A \<union> C) (B \<union> D)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Inf_pres_Inf:
  fixes F :: "('a::complete_lattice \<Rightarrow> 'b::complete_lattice) set"
  shows "\<forall>f \<in> F. Inf_pres f \<Longrightarrow> Inf_pres (\<Sqinter>F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>F. Inf_pres f \<Longrightarrow> Inf_pres (\<Sqinter> F)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>f\<in>F. Inf_pres f \<Longrightarrow> Inf_pres (\<Sqinter> F)
[PROOF STEP]
assume h: "\<forall>f \<in> F. f \<circ> Inf = Inf \<circ> image f"
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. Inf_pres f

goal (1 subgoal):
 1. \<forall>f\<in>F. Inf_pres f \<Longrightarrow> Inf_pres (\<Sqinter> F)
[PROOF STEP]
hence "\<forall>f \<in> F. Inf \<circ> image (\<Sqinter>F) \<le> f \<circ> Inf"
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>F. Inf_pres f

goal (1 subgoal):
 1. \<forall>f\<in>F. Inf \<circ> (`) (\<Sqinter> F) \<le> f \<circ> Inf
[PROOF STEP]
by (simp add: le_fun_def, safe, meson INF_lower INF_mono)
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. Inf \<circ> (`) (\<Sqinter> F) \<le> f \<circ> Inf

goal (1 subgoal):
 1. \<forall>f\<in>F. Inf_pres f \<Longrightarrow> Inf_pres (\<Sqinter> F)
[PROOF STEP]
hence "Inf \<circ> image (\<Sqinter>F) \<le> (\<Sqinter>F) \<circ> Inf"
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>F. Inf \<circ> (`) (\<Sqinter> F) \<le> f \<circ> Inf

goal (1 subgoal):
 1. Inf \<circ> (`) (\<Sqinter> F) \<le> \<Sqinter> F \<circ> Inf
[PROOF STEP]
by (simp add: le_INF_iff le_fun_def)
[PROOF STATE]
proof (state)
this:
Inf \<circ> (`) (\<Sqinter> F) \<le> \<Sqinter> F \<circ> Inf

goal (1 subgoal):
 1. \<forall>f\<in>F. Inf_pres f \<Longrightarrow> Inf_pres (\<Sqinter> F)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Inf \<circ> (`) (\<Sqinter> F) \<le> \<Sqinter> F \<circ> Inf

goal (1 subgoal):
 1. Inf_pres (\<Sqinter> F)
[PROOF STEP]
by (simp add: Inf_pres_iso h antisym iso_Inf_subdistl iso_fInf)
[PROOF STATE]
proof (state)
this:
Inf_pres (\<Sqinter> F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_sublists [simp]: "length (sublists xs) = Suc (length xs * Suc (length xs) div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (sublists xs) = Suc (length xs * Suc (length xs) div 2)
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma mset_concat: "mset (concat xss) = sum_list (map mset xss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (concat xss) = sum_list (map mset xss)
[PROOF STEP]
by (induction xss) simp_all


[STATEMENT]
lemma transpose_mult:
  "(A :: 'a :: comm_semiring_0 mat) \<in> carrier_mat nr n \<Longrightarrow> B \<in> carrier_mat n nc
  \<Longrightarrow> transpose_mat (A * B) = transpose_mat B * transpose_mat A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr n; B \<in> carrier_mat n nc\<rbrakk> \<Longrightarrow> transpose_mat (A * B) = transpose_mat B * transpose_mat A
[PROOF STEP]
by (intro eq_matI, auto simp: comm_scalar_prod[of _ n])


[STATEMENT]
lemma product_set_finite:
  "(\<And>x. x \<in> X \<Longrightarrow> finite x) \<Longrightarrow> finite (\<Otimes> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> X \<Longrightarrow> finite x) \<Longrightarrow> finite (\<Otimes> X)
[PROOF STEP]
by (cases "finite X", rotate_tac, induction X rule: finite_induct) (simp_all add: product_set_def, insert product_finite, blast)


[STATEMENT]
lemma qtmset_rev[simp]: "queue_to_multiset (rev q) = queue_to_multiset q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_to_multiset (rev q) = queue_to_multiset q
[PROOF STEP]
apply(induct q)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. queue_to_multiset (rev []) = queue_to_multiset []
 2. \<And>a q. queue_to_multiset (rev q) = queue_to_multiset q \<Longrightarrow> queue_to_multiset (rev (a # q)) = queue_to_multiset (a # q)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a q. queue_to_multiset (rev q) = queue_to_multiset q \<Longrightarrow> queue_to_multiset (rev (a # q)) = queue_to_multiset (a # q)
[PROOF STEP]
apply(simp add: union_ac)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lemma_2_6_20:
  "a \<in> infimum A \<Longrightarrow> b l\<rightarrow> a \<in> infimum (((l\<rightarrow>) b)`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> infimum A \<Longrightarrow> b l\<rightarrow> a \<in> infimum ((l\<rightarrow>) b ` A)
[PROOF STEP]
apply (subst infimum_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> infimum A \<Longrightarrow> b l\<rightarrow> a \<in> {a \<in> lower_bound ((l\<rightarrow>) b ` A). \<forall>x\<in>lower_bound ((l\<rightarrow>) b ` A). x \<le> a}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<in> infimum A \<Longrightarrow> b l\<rightarrow> a \<in> lower_bound ((l\<rightarrow>) b ` A)
 2. \<And>x. \<lbrakk>a \<in> infimum A; x \<in> lower_bound ((l\<rightarrow>) b ` A)\<rbrakk> \<Longrightarrow> x \<le> b l\<rightarrow> a
[PROOF STEP]
apply (simp add: infimum_def lower_bound_def lemma_2_5_12_a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a \<in> infimum A; x \<in> lower_bound ((l\<rightarrow>) b ` A)\<rbrakk> \<Longrightarrow> x \<le> b l\<rightarrow> a
[PROOF STEP]
by (simp add: infimum_def lower_bound_def left_residual  [THEN sym])


[STATEMENT]
lemma path_connected_eq_homotopic_points:
    "path_connected S \<longleftrightarrow>
      (\<forall>a b. a \<in> S \<and> b \<in> S \<longrightarrow> homotopic_loops S (linepath a a) (linepath b b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected S = (\<forall>a b. a \<in> S \<and> b \<in> S \<longrightarrow> homotopic_loops S (linepath a a) (linepath b b))
[PROOF STEP]
by (auto simp: path_connected_def path_component_def homotopic_points_eq_path_component)


[STATEMENT]
lemma closedin_prod_Times_iff:
   "closedin (prod_topology X Y) (S \<times> T) \<longleftrightarrow> S = {} \<or> T = {} \<or> closedin X S \<and> closedin Y T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (prod_topology X Y) (S \<times> T) = (S = {} \<or> T = {} \<or> closedin X S \<and> closedin Y T)
[PROOF STEP]
by (auto simp: closure_of_Times times_eq_iff simp flip: closure_of_eq)


[STATEMENT]
lemma inverse_less_iff_less_neg [simp]:
  "a < 0 \<Longrightarrow> b < 0 \<Longrightarrow> inverse a < inverse b \<longleftrightarrow> b < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < (0::'a); b < (0::'a)\<rbrakk> \<Longrightarrow> (inverse a < inverse b) = (b < a)
[PROOF STEP]
by (metis local.antisym_conv2 local.inverse_less_imp_less_neg local.negative_imp_inverse_negative
      local.nonzero_inverse_inverse_eq local.order.strict_implies_order)


[STATEMENT]
lemma primitive_part_neg [simp]:
  fixes a::"'a :: {factorial_ring_gcd,factorial_semiring_multiplicative} poly"
  shows "primitive_part (-a) = - primitive_part a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive_part (- a) = - primitive_part a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primitive_part (- a) = - primitive_part a
[PROOF STEP]
have "primitive_part (-a) = primitive_part (smult (-1) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive_part (- a) = primitive_part (smult (- (1::'a)) a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
primitive_part (- a) = primitive_part (smult (- (1::'a)) a)

goal (1 subgoal):
 1. primitive_part (- a) = - primitive_part a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
primitive_part (- a) = primitive_part (smult (- (1::'a)) a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
primitive_part (- a) = primitive_part (smult (- (1::'a)) a)

goal (1 subgoal):
 1. primitive_part (- a) = - primitive_part a
[PROOF STEP]
unfolding primitive_part_smult
[PROOF STATE]
proof (prove)
using this:
primitive_part (- a) = smult (unit_factor (- (1::'a))) (primitive_part a)

goal (1 subgoal):
 1. primitive_part (- a) = - primitive_part a
[PROOF STEP]
by (simp add: is_unit_unit_factor)
[PROOF STATE]
proof (state)
this:
primitive_part (- a) = - primitive_part a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma expands_to_imp_eventually_pos:
  assumes "basis_wf basis" "(f expands_to F) basis" "trimmed_pos F"
  shows   "eventually (\<lambda>x. f x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
using eval_pos_if_dominant_term_pos[of basis F] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>basis_wf basis; is_expansion F basis; trimmed F; 0 < fst (dominant_term F)\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. 0 < eval F x
basis_wf basis
(f expands_to F) basis
trimmed_pos F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < f x
[PROOF STEP]
by (auto simp: expands_to.simps trimmed_pos_def elim: eventually_elim2)


[STATEMENT]
lemma sing_pow_card_set:  assumes "k \<noteq> 0" and "c = [a]\<^sup>@k" shows "card(set c) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set c) = 1
[PROOF STEP]
using sing_pow_card_set_Suc[of c a "k - 1", unfolded Suc_minus[OF \<open>k \<noteq> 0\<close>], OF \<open>c = [a]\<^sup>@k\<close>]
[PROOF STATE]
proof (prove)
using this:
card (set c) = 1

goal (1 subgoal):
 1. card (set c) = 1
[PROOF STEP]
.


[STATEMENT]
lemma poly_of_vec_of_poly[simp]:
  fixes p :: "'a :: comm_monoid_add poly"
  shows "poly_of_vec (vec_of_poly p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vec (vec_of_poly p) = p
[PROOF STEP]
unfolding poly_of_vec_def vec_of_poly_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<dim_vec (vec (Suc (degree p)) (\<lambda>i. coeff p (degree p - i))). monom (vec (Suc (degree p)) (\<lambda>i. coeff p (degree p - i)) $ (dim_vec (vec (Suc (degree p)) (\<lambda>i. coeff p (degree p - i))) - Suc i)) i) = p
[PROOF STEP]
unfolding dim_vec
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<Suc (degree p). monom (vec (Suc (degree p)) (\<lambda>i. coeff p (degree p - i)) $ (Suc (degree p) - Suc i)) i) = p
[PROOF STEP]
unfolding lessThan_Suc_atMost
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree p. monom (vec (Suc (degree p)) (\<lambda>i. coeff p (degree p - i)) $ (Suc (degree p) - Suc i)) i) = p
[PROOF STEP]
using poly_as_sum_of_monoms[of p]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>degree p. monom (coeff p i) i) = p

goal (1 subgoal):
 1. (\<Sum>i\<le>degree p. monom (vec (Suc (degree p)) (\<lambda>i. coeff p (degree p - i)) $ (Suc (degree p) - Suc i)) i) = p
[PROOF STEP]
by auto


[STATEMENT]
lemma mat_extension_trace:
  assumes "m \<in> carrier_mat d1 d1"
  shows "trace (mat_extension m) = d2 * trace m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (mat_extension m) = int d2 * trace m
[PROOF STEP]
unfolding mat_extension_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (tensor_mat m (1\<^sub>m d2)) = int d2 * trace m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<in> carrier_mat d1 d1

goal (1 subgoal):
 1. trace (tensor_mat m (1\<^sub>m d2)) = int d2 * trace m
[PROOF STEP]
by (simp add: tensor_mat_trace)


[STATEMENT]
lemma frechet_derivative_sum_fun:
  "(\<And>i. i \<in> I \<Longrightarrow> (f i differentiable at a)) \<Longrightarrow>
  frechet_derivative (\<Sum>i\<in>I. f i) (at a) = (\<Sum>i\<in>I. frechet_derivative (f i) (at a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> f i differentiable at a) \<Longrightarrow> frechet_derivative (sum f I) (at a) = (\<Sum>i\<in>I. frechet_derivative (f i) (at a))
[PROOF STEP]
by (induction I rule: infinite_finite_induct)
    (auto simp: frechet_derivative_zero_fun frechet_derivative_plus_fun differentiable_sum_fun)


[STATEMENT]
lemma ord_zero_le_diff: "(0 \<le> (b::'a::ordered_ab_group_add) - a) = (a \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) \<le> b - a) = (a \<le> b)
[PROOF STEP]
by (simp add: le_diff_eq)


[STATEMENT]
lemma ennreal_suminf_bound_add:
  fixes f :: "nat \<Rightarrow> ennreal"
  shows "(\<And>N. (\<Sum>n<N. f n) + y \<le> x) \<Longrightarrow> suminf f + y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. sum f {..<N} + y \<le> x) \<Longrightarrow> suminf f + y \<le> x
[PROOF STEP]
by transfer (auto intro!: suminf_bound_add)


[STATEMENT]
lemma connected_space_closedin_eq:
     "connected_space X \<longleftrightarrow>
       (\<nexists>E1 E2. closedin X E1 \<and> closedin X E2 \<and>
                E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space X = (\<nexists>E1 E2. closedin X E1 \<and> closedin X E2 \<and> E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})
[PROOF STEP]
by (metis closedin_Un closedin_def connected_space_closedin subset_antisym)


[STATEMENT]
lemma mset_mult_add_2:
  assumes "mset a = mset b + mset c"
  shows "prod_list (map i a::'b::field list) = prod_list (map i b) * prod_list (map i c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map i a) = prod_list (map i b) * prod_list (map i c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prod_list (map i a) = prod_list (map i b) * prod_list (map i c)
[PROOF STEP]
have r:"mset (map i a) = mset (map i b) + mset (map i c) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map i a) = mset (map i b) + mset (map i c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mset a = mset b + mset c

goal (1 subgoal):
 1. mset (map i a) = mset (map i b) + mset (map i c)
[PROOF STEP]
by (metis map_append mset_append mset_map)
[PROOF STATE]
proof (state)
this:
mset (map i a) = mset (map i b) + mset (map i c)

goal (1 subgoal):
 1. prod_list (map i a) = prod_list (map i b) * prod_list (map i c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map i a) = prod_list (map i b) * prod_list (map i c)
[PROOF STEP]
using mset_mult_add[OF r]
[PROOF STATE]
proof (prove)
using this:
prod_list (map i a) = prod_list (map i b) * prod_list (map i c)

goal (1 subgoal):
 1. prod_list (map i a) = prod_list (map i b) * prod_list (map i c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prod_list (map i a) = prod_list (map i b) * prod_list (map i c)

goal:
No subgoals!
[PROOF STEP]
qed