Section defs.
Variable X : Setoid.
(** - ``B properly contains A'' means $A\subset B$ and $A\neq B$, so ``no member of F properly contains A'' is $\not\exists B\in F. A\subset B\wedge A\neq B$: *)
Definition maximal (F : part_set (part_set X)) (A : part_set X) :=
in_part A F /\
~ (exists B : part_set X, in_part B F /\ included A B /\ ~ A =' B in _).
Definition is_chain (F : part_set (part_set X)) :=
forall A B : part_set X,
in_part A F -> in_part B F -> included A B \/ included B A.
(** - Quoting the Maximal Principle from page 50:  Let $\cal F$ be a family of sets. If for each chain $\cal C\subset \cal F$ there exists a member of $\cal F$ that contains each member of $\cal C$, then $\cal F$ contains a maximal element.*)
(** %\tocdef{MAXIMAL\_PRINCIPLE}% *)
Axiom
MAXIMAL_PRINCIPLE :
forall F : part_set (part_set X),
(forall C : part_set (part_set X),
is_chain C ->
included C F ->
exists A : part_set X,
in_part A F /\ (forall B : part_set X, in_part B C -> included B A)) ->
exists A : part_set X, maximal F A.
End defs.
intros.
red in |- *.
assert (lin_indep beta).
red in H0.
inversion_clear H0.
inversion_clear H2; auto.
split; auto.
cut (included W (span beta:part_set _)).
intro.
red in |- *.
red in H.
apply included_antisym; auto with algebra.
apply included_comp with (span W:part_set _) (span beta:part_set _);
auto with algebra.
apply span_smallest_subspace_containing_subset; auto with algebra.
apply NNPP; intro.
assert (exists x : W, ~ in_part (W x) (span beta:part_set _)).
apply NNPP; intro; apply H2.
red in |- *.
intros.
apply NNPP; intro.
apply H3.
red in H4; exists (Build_subtype H4).
intro; apply H5.
simpl in H6.
simpl in |- *.
auto.
inversion_clear H3.
assert (~ in_part (W x) beta).
intro; apply H4.
apply set_included_in_its_span; auto with algebra.
assert (lin_indep (union beta (single (W x)))).
elim (lin_dep_vs_span_lemma H1 H3).
intros.
intro.
apply H4; auto with algebra.
red in H0.
inversion_clear H0.
inversion_clear H7.
apply H5; auto with algebra.
apply H8; auto with algebra.
apply in_part_comp_l with (subtype_elt x); auto with algebra.
Qed.

(** - %\intoc{Corollary to 1.12}%: *)
Lemma basis_iff_max_lin_indep :
forall (F : field) (V : vectorspace F) (beta : part_set V),
is_basis beta <-> max_lin_indep beta (full V).