Module mathcomp.classical.boolp

From HB Require Import structures.
From mathcomp Require Import boot order.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require internal_Eqdep_dec.

# Classical Logic This file provides the axioms of classical logic and tools to perform classical reasoning in the Mathematical Component framework. The three axioms are taken from the standard library of Coq, more details can be found in Section 5 of - R. Affeldt, C. Cohen, D. Rouhling. Formalization Techniques for Asymptotic Reasoning in Classical Analysis. JFR 2018 ## Axioms ``` functional_extensionality_dep == functional extensionality (on dependently typed functions), i.e., functions that are pointwise equal are equal propositional_extensionality == propositional extensionality, i.e., iff and equality are the same on Prop constructive_indefinite_description == existential in Prop (ex) implies existential in Type (sig) cid := constructive_indefinite_description (shortcut) ``` A number of properties are derived below from these axioms and are often more pratical to use than directly using the axioms. For instance propext, funext, the excluded middle (EM),... ## Boolean View of Prop ``` `[< P >] == boolean view of P : Prop, see all lemmas about asbool ``` ## Mathematical Components Structures - A decidable equality is defined for any type. It is thus possible to define an eqType structure for any type using the mixin `gen_eqMixin`. - This file adds the possibility to define a choiceType structure for any type thanks to an axiom `gen_choiceMixin` giving a choice mixin. - We chose to have generic mixins and no global instances of the eqType and choiceType structures to let the user choose which definition of equality to use and to avoid conflict with already declared instances. ``` {classic T} == Endow T : Type with a canonical eqType/choiceType. This is intended for local use. E.g., T : Type |- A : {fset {classic T}} Alternatively one may use elim/Pchoice: T => T in H *. to substitute T with T : choiceType once and for all. {eclassic T} == Endow T : eqType with a canonical choiceType. On the model of {classic _}. See also the lemmas Peq and eqPchoice. ``` Functions onto a porderType (resp. latticeType) are equipped with a porderType (resp. latticeType), so that the generic notation (_ <= _)%O (resp. `&`, `|`) from `order.v` can be used. ``` FunOrder.lef f g == pointwise large inequality between two functions FunOrder.ltf f g == pointwise strict inequality between two functions FunLattice.meetf f g == pointwise meet between two functions FunLattice.joinf f g == pointwise join between two functions ```

Unset SsrOldRewriteGoalsOrder.  
Set   Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Declare Scope box_scope.
Declare Scope quant_scope.

Axiom
functional_extensionality_depUsed by
  • mathcomp.classical.classical_orders
  • mathcomp.analysis.cantor
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
:
       forall ( : Type) ( : A -> Type) ( : forall : A, B x),
       (forall : A, f x = g x) -> f = g.
Axiom
propositional_extensionalitySource code
:
       forall : Prop, P <-> Q -> P = Q.

Axiom
constructive_indefinite_descriptionSource code
:
  forall ( : Type) ( : A -> Prop),
  (exists : A, P x) -> { : A | P x}.
Notation
cidUsed by
  • mathcomp.experimental_reals.discrete
  • mathcomp.classical.contra
  • mathcomp.classical.fsbigop
  • mathcomp.classical.functions
  • mathcomp.classical.cardinality
  • mathcomp.classical.wochoice
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.cantor
  • mathcomp.analysis.sequences
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.numfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.topology_theory.supremum_topology
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.kernel
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.measure_negligible
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.homotopy_theory.wedge_sigT
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.vitali_lemma
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.urysohn

Source code
:= constructive_indefinite_description.

Lemma
cid2Used by
  • mathcomp.classical.contra
  • mathcomp.classical.functions
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.cantor
  • mathcomp.analysis.sequences
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.lebesgue_stieltjes_measure
  • mathcomp.analysis.probability_theory.independence
  • mathcomp.analysis.topology_theory.supremum_topology
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.realfun
  • mathcomp.analysis.kernel
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.normedtype_theory.tvs

Source code
 ( : Type) ( : A -> Prop) :
  (exists2 : A, P x & Q x) -> { : A | P x & Q x}.
Proof.
move=> PQA; suff: { | P x /\ Q x} by move=> [a [*]]; exists a.
by apply: cid; case: PQA => x; exists x.
Qed.

Lemma
existT_inj1Used by
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
 ( : Type) ( : T -> Type) ( : T) ( : P x) ( : P y) :
  existT P x Px = existT P y Py -> x = y.
Proof.
by case. Qed.

Lemma
existT_inj2Used by
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
 ( : eqType) ( : T -> Type) ( : T) ( : P x) :
  existT P x Px1 = existT P x Px2 -> Px1 = Px2.
Proof.
apply: internal_Eqdep_dec.inj_pair2_eq_dec => y z.
by have [|/eqP] := eqVneq y z; [left|right].
Qed.

Lemma
surjective_existTUsed by
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
 ( : Type) ( : T -> Type) ( : { : T & P x}):
  existT [eta P] (projT1 p) (projT2 p) = p.
Proof.
by case: p. Qed.

Record
mextensionalitySource code
:= {
  _ : forall ( : Prop), (P <-> Q) -> (P = Q);
  _ : forall { : Type} ( : T -> U),
        (forall , f x = g x) -> f = g;
}.

Fact
extensionalitySource code
: mextensionality.
Proof.
split.
- exact: propositional_extensionality.
- by move=> T U f g; apply: functional_extensionality_dep.
Qed.

Lemma
propextUsed by
  • mathcomp.classical.contra
  • mathcomp.classical.fsbigop
  • mathcomp.classical.functions
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.esum
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.kernel
  • mathcomp.analysis.homotopy_theory.wedge_sigT
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule

Source code
 ( : Prop) : (P <-> Q) -> (P = Q).
Proof.
by have [propext _] := extensionality; apply: propext. Qed.

Ltac eqProp := apply: propext; split.

Lemma
funextUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.contra
  • mathcomp.classical.filter
  • mathcomp.classical.functions
  • mathcomp.classical.cardinality
  • mathcomp.classical.wochoice
  • mathcomp.classical.classical_sets
  • mathcomp.analysis_stdlib.Rstruct_topology
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.esum
  • mathcomp.analysis.sequences
  • mathcomp.analysis.pi_irrational
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
  • mathcomp.analysis.lebesgue_integral_theory.simple_functions
  • mathcomp.analysis.lebesgue_integral_theory.giry
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_under
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.exp
  • mathcomp.analysis.numfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.lebesgue_stieltjes_measure
  • mathcomp.analysis.probability_theory.independence
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.probability_theory.normal_distribution
  • mathcomp.analysis.probability_theory.uniform_distribution
  • mathcomp.analysis.probability_theory.poisson_distribution
  • mathcomp.analysis.probability_theory.bernoulli_distribution
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.probability_theory.binomial_distribution
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.order_topology
  • mathcomp.analysis.topology_theory.uniform_structure
  • mathcomp.analysis.topology_theory.nat_topology
  • mathcomp.analysis.topology_theory.metric_structure
  • mathcomp.analysis.gauss_integral
  • mathcomp.analysis.realfun
  • mathcomp.analysis.kernel
  • mathcomp.analysis.ftc
  • mathcomp.analysis.measure_theory.probability_measure
  • mathcomp.analysis.measure_theory.dirac_measure
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.measure_theory.measurable_function
  • mathcomp.analysis.measure_theory.counting_measure
  • mathcomp.analysis.homotopy_theory.wedge_sigT
  • mathcomp.analysis.homotopy_theory.continuous_path
  • mathcomp.analysis.hoelder
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.elementary_functions.trigonometry_functions
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.urysohn
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule

Source code
{ : Type} ( : T -> U) : (f =1 g) -> f = g.
Proof.
by case: extensionality=> _; apply. Qed.

Lemma
propeqEUsed by
  • mathcomp.reals_stdlib.Rstruct
  • mathcomp.classical.filter
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.landau
  • mathcomp.analysis.esum
  • mathcomp.analysis.sequences
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.realfun
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : Prop) : (P = Q) = (P <-> Q).
Proof.
by apply: propext; split=> [->|/propext]. Qed.

Lemma
propeqPUsed by
  • mathcomp.classical.functions
  • mathcomp.classical.cardinality
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : Prop) : (P = Q) <-> (P <-> Q).
Proof.
by rewrite propeqE. Qed.

Lemma
funeqEUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.filter
  • mathcomp.classical.functions
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.landau
  • mathcomp.analysis.sequences
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.exp
  • mathcomp.analysis.numfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.discrete_topology
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.realfun
  • mathcomp.analysis.kernel
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.elementary_functions.trigonometry_functions
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.matrix_normedtype
  • mathcomp.analysis.normedtype_theory.ereal_normedtype
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule

Source code
{ : Type} ( : T -> U) : (f = g) = (f =1 g).
Proof.
by rewrite propeqE; split=> [->//|/funext]. Qed.

Lemma
funeq2EUsed by
  • mathcomp.classical.functions
  • mathcomp.analysis.sequences
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.discrete_topology
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule

Source code
{ : Type} ( : T -> U -> V) : (f = g) = (f =2 g).
Proof.
by rewrite propeqE; split=> [->//|?]; rewrite funeqE=> x; rewrite funeqE.
Qed.

Lemma
funeq3EUsed by
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule

Source code
{ : Type} ( : T -> U -> V -> W) :
  (f = g) = (forall , f x y z = g x y z).
Proof.
by rewrite propeqE; split=> [->//|?]; rewrite funeq2E=> x y; rewrite funeqE.
Qed.

Lemma
funeqPUsed by
  • mathcomp.classical.functions
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.probability_theory.exponential_distribution
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.ereal_normedtype

Source code
{ : Type} ( : T -> U) : (f = g) <-> (f =1 g).
Proof.
by rewrite funeqE. Qed.

Lemma { : Type} ( : T -> U -> V) : (f = g) <-> (f =2 g).
Proof.
by rewrite funeq2E. Qed.

Lemma { : Type} ( : T -> U -> V -> W) :
  (f = g) <-> (forall , f x y z = g x y z).
Proof.
by rewrite funeq3E. Qed.

Lemma
predeqEUsed by
  • mathcomp.reals.real_interval
  • mathcomp.reals.reals
  • mathcomp.experimental_reals.realsum
  • mathcomp.classical.set_interval
  • mathcomp.classical.filter
  • mathcomp.classical.functions
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.esum
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.initial_topology
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.supremum_topology
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.product_topology
  • mathcomp.analysis.topology_theory.matrix_topology
  • mathcomp.analysis.topology_theory.discrete_topology
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.measure_theory.dirac_measure
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.measure_theory.measure_negligible
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.matrix_normedtype
  • mathcomp.analysis.normedtype_theory.ereal_normedtype
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
{} ( : T -> Prop) : (P = Q) = (forall , P x <-> Q x).
Proof.
by rewrite propeqE; split=> [->//|?]; rewrite funeqE=> x; rewrite propeqE.
Qed.

Lemma
predeq2EUsed by
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.initial_topology
  • mathcomp.analysis.topology_theory.one_point_compactification
  • mathcomp.analysis.topology_theory.supremum_topology
  • mathcomp.analysis.topology_theory.product_topology
  • mathcomp.analysis.topology_theory.matrix_topology
  • mathcomp.analysis.topology_theory.pseudometric_structure

Source code
{ } ( : T -> U -> Prop) :
   (P = Q) = (forall , P x y <-> Q x y).
Proof.
by rewrite propeqE; split=> [->//|?]; rewrite funeq2E=> ??; rewrite propeqE.
Qed.

Lemma
predeq3EUsed by
  • mathcomp.analysis.normedtype_theory.matrix_normedtype

Source code
{ } ( : T -> U -> V -> Prop) :
   (P = Q) = (forall , P x y z <-> Q x y z).
Proof.
by rewrite propeqE; split=> [->//|?]; rewrite funeq3E=> ???; rewrite propeqE.
Qed.

Lemma
predeqPUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.filter
  • mathcomp.classical.fsbigop
  • mathcomp.classical.functions
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.numfun
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.uniform_structure
  • mathcomp.analysis.realfun
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.ess_sup_inf
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
{} ( : T -> Prop) : (A = B) <-> (forall , A x <-> B x).
Proof.
by rewrite predeqE. Qed.

Lemma
predeq2PSource code
{ } ( : T -> U -> Prop) :
   (P = Q) <-> (forall , P x y <-> Q x y).
Proof.
by rewrite predeq2E. Qed.

Lemma
predeq3PSource code
{ } ( : T -> U -> V -> Prop) :
   (P = Q) <-> (forall , P x y z <-> Q x y z).
Proof.
by rewrite predeq3E. Qed.

Lemma
propTUsed by
  • mathcomp.classical.functions
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.measurable_realfun

Source code
{ : Prop} : P -> P = True.
Proof.
by move=> p; rewrite propeqE. Qed.

Lemma
Prop_irrelevanceUsed by
  • mathcomp.classical.functions
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.kernel
  • mathcomp.analysis.homotopy_theory.continuous_path
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.normedtype_theory.tvs

Source code
 ( : Prop) ( : P) : x = y.
Proof.
by move: x (x) y => /propT-> [] []. Qed.
#[global] Hint Resolve Prop_irrelevance : core.

Record
mclassicSource code
:= {
  _ : forall ( : Prop), {P} + {~P};
  _ : forall , hasChoice T
}.

Lemma
choiceUsed by
  • mathcomp.analysis.sequences
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_under
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.lebesgue_stieltjes_measure
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem

Source code
 ( : X -> Y -> Prop) :
  (forall , exists , P x y) -> { & forall , P x (f x)}.
Proof.

Theorem : P \/ ~ P.
Proof.
pose U := fun : bool => Q = val \/ P.
have Uex val : exists , U val b by exists val; left.
pose f := projT1 (cid (Uex val)).
pose Uf : U val (f val) := projT2 (cid (Uex val)).
have : f true != f false \/ P.
  have [] := (Uf true, Uf false); rewrite /U.
  by move=> [->|?] [->|?] ; do ?[by right]; left.
move=> [/eqP fTFN|]; [right=> p|by left]; apply: fTFN.
have UTF : U true = U false by rewrite predeqE /U => b; split=> _; right.
rewrite /f; move: (Uex true) (Uex false); rewrite UTF => p1 p2.
by congr (projT1 (cid _)).
Qed.

Lemma
pselectUsed by
  • mathcomp.reals.reals
  • mathcomp.experimental_reals.realsum
  • mathcomp.classical.filter
  • mathcomp.classical.fsbigop
  • mathcomp.classical.functions
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.cantor
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
  • mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.numfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.probability_theory.independence
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.one_point_compactification
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.supremum_topology
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.order_topology
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.realfun
  • mathcomp.analysis.kernel
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.counting_measure
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.vitali_lemma
  • mathcomp.analysis.normedtype_theory.urysohn
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule

Source code
 ( : Prop): {P} + {~P}.
Proof.
have : exists , if b then P else ~ P.
  by case: (EM P); [exists true|exists false].
by move=> /cid [[]]; [left|right].
Qed.

Lemma
pselectTSource code
: (T -> False) + T.
Proof.
have [/cid[]//|NT] := pselect (exists : T, True); first by right.
by left=> t; case: NT; exists t.
Qed.

Lemma : mclassic.
Proof.
split=> [|T]; first exact: pselect.
exists (fun ( : pred T) ( : nat) =>
  if pselect (exists , P x) isn't left ex then None
  else Some (projT1 (cid ex)))
  => [P n x|P [x Px]|P Q /funext -> //].
  by case: pselect => // ex [<- ]; case: cid.
by exists 0; case: pselect => // -[]; exists x.
Qed.

Lemma
gen_choiceMixinUsed by
  • mathcomp.classical.filter
  • mathcomp.analysis.cantor
  • mathcomp.analysis.lebesgue_integral_theory.giry
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.measure_theory.probability_measure
  • mathcomp.analysis.homotopy_theory.continuous_path
  • mathcomp.analysis.hoelder

Source code
 ( : Type) : hasChoice T.
Proof.
by case: classic. Qed.

Lemma
lemUsed by
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem

Source code
 ( : Prop): P \/ ~P.
Proof.
by case: (pselect P); tauto. Qed.

Lemma
trueEUsed by
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.normedtype_theory.ereal_normedtype

Source code
: true = True :> Prop.
Proof.
by rewrite propeqE; split. Qed.

Lemma
falseEUsed by
  • mathcomp.classical.cardinality
  • mathcomp.analysis.exp
  • mathcomp.analysis.derive
  • mathcomp.analysis.probability_theory.independence
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.realfun
  • mathcomp.analysis.normedtype_theory.ereal_normedtype
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
: false = False :> Prop.
Proof.
by rewrite propeqE; split. Qed.

Lemma
propFUsed by
  • mathcomp.classical.classical_sets

Source code
 ( : Prop) : ~ P -> P = False.
Proof.
by move=> p; rewrite propeqE; tauto. Qed.

Lemma
eq_funUsed by
  • mathcomp.reals.reals
  • mathcomp.classical.filter
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.esum
  • mathcomp.analysis.sequences
  • mathcomp.analysis.pi_irrational
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
  • mathcomp.analysis.lebesgue_integral_theory.giry
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_under
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.numfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.probability_theory.independence
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.probability_theory.normal_distribution
  • mathcomp.analysis.probability_theory.poisson_distribution
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.probability_theory.exponential_distribution
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.edist
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.gauss_integral
  • mathcomp.analysis.realfun
  • mathcomp.analysis.kernel
  • mathcomp.analysis.ftc
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.measure_theory.counting_measure
  • mathcomp.analysis.hoelder
  • mathcomp.analysis.ess_sup_inf
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.ereal_normedtype
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : T -> rT) :
  (forall : T, U x = V x) -> (fun => U x) = (fun => V x).
Proof.
by move=> /funext->. Qed.

Lemma  ( : T1 -> T2 -> rT) :
  (forall , U x y = V x y) -> (fun => U x y) = (fun => V x y).
Proof.
by move=> UV; rewrite funeq2E => x y; rewrite UV. Qed.

Lemma     ( : T1 -> T2 -> T3 -> rT) :
  (forall , U x y z = V x y z) ->
  (fun => U x y z) = (fun => V x y z).
Proof.
by move=> UV; rewrite funeq3E => x y z; rewrite UV. Qed.

Lemma
eq_forallUsed by
  • mathcomp.classical.filter
  • mathcomp.classical.cardinality
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.edist
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.topology_theory.metric_structure
  • mathcomp.analysis.realfun
  • mathcomp.analysis.normedtype_theory.ereal_normedtype
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : T -> Prop) :
  (forall : T, U x = V x) -> (forall , U x) = (forall , V x).
Proof.
by move=> e; rewrite propeqE; split=> ??; rewrite (e,=^~e). Qed.

Lemma
eq2_forallUsed by
  • mathcomp.analysis.topology_theory.topology_structure

Source code
 ( : forall : T, S x -> Prop) :
  (forall , U x y = V x y) -> (forall , U x y) = (forall , V x y).
Proof.
by move=> UV; apply/eq_forall => x; exact/eq_forall. Qed.

Lemma
eq3_forallSource code
 ( : forall ( : T) ( : S x), R x y -> Prop) :
  (forall , U x y z = V x y z) ->
  (forall , U x y z) = (forall , V x y z).
Proof.
by move=> UV; apply/eq2_forall => x y; exact/eq_forall. Qed.

Lemma
eq_existsUsed by
  • mathcomp.reals_stdlib.Rstruct
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.realfun

Source code
 ( : T -> Prop) :
  (forall : T, U x = V x) -> (exists , U x) = (exists , V x).
Proof.
by move=> e; rewrite propeqE; split=> - [] x ?; exists x; rewrite (e,=^~e).
Qed.

Lemma
eq2_existsSource code
 ( : forall : T, S x -> Prop) :
  (forall , U x y = V x y) -> (exists , U x y) = (exists , V x y).
Proof.
by move=> UV; apply/eq_exists => x; exact/eq_exists. Qed.

Lemma
eq3_existsSource code
 ( : forall ( : T) ( : S x), R x y -> Prop) :
  (forall , U x y z = V x y z) ->
  (exists , U x y z) = (exists , V x y z).
Proof.
by move=> UV; apply/eq2_exists => x y; exact/eq_exists. Qed.

Lemma
eq_existUsed by
  • mathcomp.classical.classical_sets

Source code
 ( : T -> Prop) ( : T) ( : P s) ( : P t) :
  s = t -> exist P s p = exist P t q.
Proof.
by move=> st; case: _ / st in q *; apply/congr1. Qed.

Lemma
forall_swapUsed by
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
 ( : forall ( : T) ( : S), Prop) :
   (forall , U x y) = (forall , U x y).
Proof.
by rewrite propeqE; split. Qed.

Lemma
exists_swapSource code
 ( : forall ( : T) ( : S), Prop) :
   (exists , U x y) = (exists , U x y).
Proof.
by rewrite propeqE; split => -[x [y]]; exists y, x. Qed.

Lemma
reflect_eqUsed by
  • mathcomp.classical.contra

Source code
 ( : Prop) ( : bool) : reflect P b -> P = b.
Proof.
by rewrite propeqE; exact: rwP. Qed.

Definition  ( : Prop) := if pselect P then true else false.

Notation 
"`[< P >]"Source code
:= (asbool P) : bool_scope.

Lemma
asboolEUsed by
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.normedtype_theory.tvs

Source code
 ( : Prop) : `[<P>] = P :> Prop.
Proof.
by rewrite propeqE /asbool; case: pselect; split. Qed.

Lemma
asboolPUsed by
  • mathcomp.reals.reals
  • mathcomp.experimental_reals.realseq
  • mathcomp.experimental_reals.discrete
  • mathcomp.experimental_reals.distr
  • mathcomp.experimental_reals.realsum
  • mathcomp.classical.contra
  • mathcomp.classical.filter
  • mathcomp.classical.cardinality
  • mathcomp.classical.wochoice
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.landau
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.numfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.lebesgue_stieltjes_measure
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.supremum_topology
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.hoelder
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.urysohn

Source code
 ( : Prop) : reflect P `[<P>].
Proof.
by apply: (equivP idP); rewrite asboolE. Qed.

Lemma
asboolbUsed by
  • mathcomp.experimental_reals.discrete
  • mathcomp.classical.classical_sets

Source code
 ( : bool) : `[< b >] = b.
Proof.
by apply/asboolP/idP. Qed.

Lemma
asboolPnUsed by
  • mathcomp.reals.reals
  • mathcomp.experimental_reals.discrete
  • mathcomp.experimental_reals.distr
  • mathcomp.experimental_reals.realsum
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.sequences
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
 ( : Prop) : reflect (~ P) (~~ `[<P>]).
Proof.
by rewrite /asbool; case: pselect=> h; constructor. Qed.

Lemma
asboolWUsed by
  • mathcomp.experimental_reals.distr

Source code
 ( : Prop) : `[<P>] -> P.
Proof.
by case: asboolP. Qed.

Lemma
orWUsed by
  • mathcomp.analysis.sequences

Source code
: A \/ B -> A + B.
Proof.
have [|NA] := asboolP A; first by left.
have [|NB] := asboolP B; first by right.
by move=> AB; exfalso; case: AB.
Qed.

Lemma : [\/ A, B | C] -> A + B + C.
Proof.
have [|NA] := asboolP A; first by left; left.
have [|NB] := asboolP B; first by left; right.
have [|NC] := asboolP C; first by right.
by move=> ABC; exfalso; case: ABC.
Qed.

Lemma : [\/ A, B, C | D] -> A + B + C + D.
Proof.
have [|NA] := asboolP A; first by left; left; left.
have [|NB] := asboolP B; first by left; left; right.
have [|NC] := asboolP C; first by left; right.
have [|ND] := asboolP D; first by right.
by move=> ABCD; exfalso; case: ABCD.
Qed.

Lemma
asboolTUsed by
  • mathcomp.reals.reals
  • mathcomp.experimental_reals.realsum
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.landau
  • mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
  • mathcomp.analysis.lebesgue_stieltjes_measure
  • mathcomp.analysis.measure_theory.counting_measure
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
 ( : Prop) : P -> `[<P>].
Proof.
by case: asboolP. Qed.

Lemma
asboolFUsed by
  • mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
  • mathcomp.analysis.measure_theory.counting_measure
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
 ( : Prop) : ~ P -> `[<P>] = false.
Proof.
by apply/introF/asboolP. Qed.

Lemma
eq_opEUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.probability_theory.random_variable

Source code
 ( : eqType) ( : T) : (x == y : Prop) = (x = y).
Proof.
by apply/propext; split=> /eqP. Qed.

Lemma
is_true_injUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.cardinality
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
: injective is_true.
Proof.
by move=> [] []; rewrite ?(trueE, falseE) ?propeqE; tauto. Qed.

Definition  ( : Type) ( : T) := `[<u = v>].
Lemma  ( : Type) : Equality.axiom (@gen_eq T).
Proof.
by move=> x y; apply: (iffP (asboolP _)). Qed.
Definition
gen_eqMixin
Used by
  • mathcomp.classical.filter
  • mathcomp.analysis.cantor
  • mathcomp.analysis.lebesgue_integral_theory.giry
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.measure_theory.probability_measure
  • mathcomp.analysis.homotopy_theory.continuous_path
  • mathcomp.analysis.hoelder

Source code
 ( : Type) : hasDecEq T :=
  hasDecEq.Build T (@gen_eqP T).

.
instanceSource code
DefinitionSource code
 () ( -> eqType) :=
  gen_eqMixin (forall : T, T' t).

.
instanceSource code
DefinitionSource code
 () ( -> choiceType) :=
  gen_choiceMixin (forall : T, T' t).

.
instanceSource code
DefinitionSource code
gen_eqMixinSource code
Prop.
.
instanceSource code
DefinitionSource code
gen_choiceMixinSource code
Prop.

Section classicType.
Variable : Type.
Definition
classicType

asbool : Prop -> bool asbool is not universe polymorphic Arguments asbool P%_type_scope asbool is transparent Expands to: Constant mathcomp.classical.boolp.asbool Declared in library mathcomp.classical.boolp, line 324, characters 11-17


Source code
:= T.
.
instanceSource code
DefinitionSource code
gen_eqMixinSource code
classicType.
.
instanceSource code
DefinitionSource code
gen_choiceMixinSource code
classicType.
End classicType.
Notation 
"'{classic' T }"Source code
:= (classicType T)
 (format "'{classic' T }") : type_scope.

Section eclassicType.
Variable : eqType.
Definition
eclassicType

gen_eq : forall [T : Type], T -> T -> bool gen_eq is not universe polymorphic Arguments gen_eq [T]%_type_scope u v gen_eq is transparent Expands to: Constant mathcomp.classical.boolp.gen_eq Declared in library mathcomp.classical.boolp, line 380, characters 11-17


Source code
: Type := T.
.
instanceSource code
DefinitionSource code
EqualitySource code
.copy eclassicType T.
.
instanceSource code
DefinitionSource code
gen_choiceMixinSource code
eclassicType.
End eclassicType.
Notation 
"'{eclassic' T }"Source code
:= (eclassicType T)
 (format "'{eclassic' T }") : type_scope.

Definition
canonical_of

gen_eqMixin : forall T : Type, hasDecEq.phant_axioms T gen_eqMixin is not universe polymorphic Arguments gen_eqMixin T%_type_scope gen_eqMixin is transparent Expands to: Constant mathcomp.classical.boolp.gen_eqMixin Declared in library mathcomp.classical.boolp, line 383, characters 11-22


Source code
 ( : U -> T) := forall ( : T -> Type),
  (forall , G (sort x')) -> forall , G x.
Notation
canonical_Source code
sort := (@canonical_of _ _ sort).
Notation
canonicalSource code
T E := (@canonical_of T E id).

Lemma  ( : U -> T) :
  (forall , exists , sort y = x) -> canonical_ sort.
Proof.
by move=> + G Gs x => /(_ x)/cid[x' <-]. Qed.
Arguments canon {T U sort} x.

Lemma
PeqUsed by
  • mathcomp.classical.fsbigop
  • mathcomp.classical.classical_sets

Source code
: canonical Type eqType.
Proof.
by apply: canon => T; exists {classic T}. Qed.
Lemma
PchoiceUsed by
  • mathcomp.classical.cardinality
  • mathcomp.analysis.measure_theory.measure_function
  • mathcomp.analysis.measure_theory.measurable_structure

Source code
: canonical Type choiceType.
Proof.
by apply: canon => T; exists {classic T}. Qed.
Lemma
eqPchoiceUsed by
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets

Source code
: canonical eqType choiceType.
Proof.
by apply: canon => T; exists {eclassic T}; case: T => //= T [?]//. Qed.

Lemma
not_TrueUsed by
  • mathcomp.analysis.topology_theory.subspace_topology

Source code
: (~ True) = False
Proof.
exact/propext. Qed.
Lemma
not_FalseUsed by
  • mathcomp.analysis.topology_theory.subspace_topology

Source code
: (~ False) = True
Proof.
by apply/propext; split=> _. Qed.

Lemma
asbool_equiv_eqSource code
{ : Prop} : (P <-> Q) -> `[<P>] = `[<Q>].
Proof.
by rewrite -propeqE => ->. Qed.

Lemma
asbool_equiv_eqPSource code
{ : Prop} : reflect Q b -> (P <-> Q) -> `[<P>] = b.
Proof.
by move=> Q_b [PQ QP]; apply/asboolP/Q_b. Qed.

Lemma
asbool_equivUsed by
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable

Source code
{ : Prop} : (P <-> Q) -> (`[<P>] <-> `[<Q>]).
Proof.
by move/asbool_equiv_eq->. Qed.

Lemma
asbool_eq_equivUsed by
  • mathcomp.classical.classical_sets

Source code
{ : Prop} : `[<P>] = `[<Q>] -> (P <-> Q).
Proof.
by move=> eq; split=> /asboolP; rewrite (eq, =^~ eq) => /asboolP. Qed.

Lemma
and_asboolPUsed by
  • mathcomp.analysis.sequences

Source code
 ( : Prop) : reflect (P /\ Q) (`[< P >] && `[< Q >]).
Proof.
apply: (iffP idP); first by case/andP => /asboolP p /asboolP q.
by case=> /asboolP-> /asboolP->.
Qed.

Lemma
and3_asboolPSource code
 ( : Prop) :
  reflect [/\ P, Q & R] [&& `[< P >], `[< Q >] & `[< R >]].
Proof.
apply: (iffP idP); first by case/and3P => /asboolP p /asboolP q /asboolP r.
by case => /asboolP -> /asboolP -> /asboolP ->.
Qed.

Lemma
or_asboolPUsed by
  • mathcomp.experimental_reals.discrete

Source code
 ( : Prop) : reflect (P \/ Q) (`[< P >] || `[< Q >]).
Proof.
apply: (iffP idP); first by case/orP=> /asboolP; [left | right].
by case=> /asboolP-> //=; rewrite orbT.
Qed.

Lemma
or3_asboolPSource code
 ( : Prop) :
  reflect [\/ P, Q | R] [|| `[< P >], `[< Q >] | `[< R >]].
Proof.
apply: (iffP idP); last by case=> [| |] /asboolP -> //=; rewrite !orbT.
by case/orP=> [/asboolP p|/orP[]/asboolP]; [exact:Or31|exact:Or32|exact:Or33].
Qed.

Lemma
asbool_negUsed by
  • mathcomp.experimental_reals.discrete
  • mathcomp.classical.filter
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.compact

Source code
{ : Prop} : `[<~ P>] = ~~ `[<P>].
Proof.
by apply/idP/asboolPn=> [/asboolP|/asboolT]. Qed.

Lemma
asbool_orUsed by
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.topology_theory.topology_structure

Source code
{ : Prop} : `[<P \/ Q>] = `[<P>] || `[<Q>].
Proof.
exact: (asbool_equiv_eqP (or_asboolP _ _)). Qed.

Lemma
asbool_andUsed by
  • mathcomp.reals.reals
  • mathcomp.classical.classical_sets

Source code
{ : Prop} : `[<P /\ Q>] = `[<P>] && `[<Q>].
Proof.
exact: (asbool_equiv_eqP (and_asboolP _ _)). Qed.

Lemma
imply_asboolPUsed by
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
{ : Prop} : reflect (P -> Q) (`[<P>] ==> `[<Q>]).
Proof.
apply: (iffP implyP)=> [PQb /asboolP/PQb/asboolW //|].
by move=> PQ /asboolP/PQ/asboolT.
Qed.

Lemma
asbool_implyUsed by
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
{ : Prop} : `[<P -> Q>] = `[<P>] ==> `[<Q>].
Proof.

Lemma
imply_asboolPnUsed by
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.compact

Source code
 ( : Prop) : reflect (P /\ ~ Q) (~~ `[<P -> Q>]).
Proof.
apply: (iffP idP).
by rewrite asbool_imply negb_imply -asbool_neg => /and_asboolP.
by move/and_asboolP; rewrite asbool_neg -negb_imply asbool_imply.
Qed.

Lemma
forall_asboolPSource code
{ : Type} ( : T -> Prop) :
  reflect (forall , `[<P x>]) (`[<forall , P x>]).
Proof.
apply: (iffP idP); first by move/asboolP=> Px x; apply/asboolP.
by move=> Px; apply/asboolP=> x; apply/asboolP.
Qed.

Lemma
exists_asboolPUsed by
  • mathcomp.experimental_reals.realseq
  • mathcomp.experimental_reals.discrete
  • mathcomp.experimental_reals.realsum

Source code
{ : Type} ( : T -> Prop) :
  reflect (exists , `[<P x>]) (`[<exists , P x>]).
Proof.
apply: (iffP idP); first by case/asboolP=> x Px; exists x; apply/asboolP.
by case=> x bPx; apply/asboolP; exists x; apply/asboolP.
Qed.


Variant
BoolPropSource code
: Prop -> Type :=
 |
TruePropSource code
: BoolProp True
 |
FalsePropSource code
: BoolProp False.

Lemma : BoolProp P.
Proof.
by case: (asboolP P) => [/propT-> | /propF->]; [left | right]. Qed.

Lemma
notBUsed by
  • mathcomp.classical.contra

Source code
: ((~ True) = False) * ((~ False) = True).
Proof.
by rewrite /not; split; eqProp. Qed.

Lemma
andBUsed by
  • mathcomp.classical.contra

Source code
: left_id True and * right_id True and
          * (left_zero False and * right_zero False and * idempotent_op and).
Proof.
by do ![split] => /PropB[]; eqProp=> // -[]. Qed.

Lemma
orBUsed by
  • mathcomp.classical.contra

Source code
: left_id False or * right_id False or
          * (left_zero True or * right_zero True or * idempotent_op or).
Proof.
do ![split] => /PropB[]; eqProp=> -[] //; by [left | right]. Qed.

Lemma : let  ( : Prop) :=  P -> Q in
    (imply False =1 fun=> True) * (imply^~ False =1 not)
  * (left_id True imply * right_zero True imply * self_inverse True imply).
Proof.
by do ![split] => /PropB[]; eqProp=> //; apply. Qed.

Lemma
decide_orUsed by
  • mathcomp.classical.contra

Source code
: P \/ Q -> {P} + {Q}.
Proof.
by case/PropB: P; [left | rewrite orB; right]. Qed.


Lemma  ( : Prop) : P = False -> ~ P.
Proof.
by move->. Qed.

Lemma
contrapTUsed by
  • mathcomp.reals.reals
  • mathcomp.reals_stdlib.Rstruct
  • mathcomp.classical.filter
  • mathcomp.classical.functions
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.realfun
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.measure_theory.counting_measure
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.tvs

Source code
: ~ ~ P -> P.
Proof.
by case: (PropB P) => //; rewrite not_False. Qed.

Lemma  ( : Prop) : (~ P) -> P = False
Proof.
by case: (PropB P). Qed.

Lemma  ( : Prop) : (~ P) = False -> P.
Proof.
by move/notT; exact: contrapT. Qed.

Lemma
notKUsed by
  • mathcomp.classical.contra
  • mathcomp.classical.fsbigop
  • mathcomp.classical.cardinality
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
: involutive not.
Proof.
by case/PropB; rewrite !(not_False,not_True). Qed.

Lemma
contra_notPUsed by
  • mathcomp.experimental_reals.discrete
  • mathcomp.classical.filter
  • mathcomp.classical.fsbigop
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.realfun
  • mathcomp.analysis.normedtype_theory.vitali_lemma

Source code
 ( : Prop) : (~ Q -> P) -> ~ P -> Q.
Proof.
by move: Q P => /PropB[] /PropB[]. Qed.

Lemma
contraPPUsed by
  • mathcomp.experimental_reals.realsum
  • mathcomp.classical.set_interval
  • mathcomp.classical.fsbigop
  • mathcomp.classical.cardinality
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.realfun
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.urysohn

Source code
 ( : Prop) : (~ Q -> ~ P) -> P -> Q.
Proof.
by move: Q P => /PropB[] /PropB[]//; rewrite not_False not_True. Qed.

Lemma
contra_notTUsed by
  • mathcomp.classical.fsbigop
  • mathcomp.classical.cardinality
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.realfun

Source code
 ( : Prop) : (~~ b -> P) -> ~ P -> b.
Proof.
by move=> bP; apply: contra_notP => /negP. Qed.

Lemma
contraPTSource code
 ( : Prop) : (~~ b -> ~ P) -> P -> b.
Proof.
by move=> /contra_notT; rewrite notK. Qed.

Lemma
contraTPUsed by
  • mathcomp.classical.fsbigop
  • mathcomp.analysis.ereal

Source code
 ( : Prop) : (~ Q -> ~~ b) -> b -> Q.
Proof.
by move=> QB; apply: contraPP => /QB/negP. Qed.

Lemma
contraNPUsed by
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.order_topology

Source code
 ( : Prop) ( : bool) : (~ P -> b) -> ~~ b -> P.
Proof.
by move=> /contra_notP + /negP => /[apply]. Qed.

Lemma
contra_neqPUsed by
  • mathcomp.classical.filter
  • mathcomp.classical.fsbigop
  • mathcomp.classical.classical_orders
  • mathcomp.analysis.esum

Source code
 ( : eqType) ( : T) : (~ P -> x = y) -> x != y -> P.
Proof.
by move=> Pxy; apply: contraNP => /Pxy/eqP. Qed.

Lemma
contra_eqPSource code
 ( : eqType) ( : T) : (~ Q -> x != y) -> x = y -> Q.
Proof.
by move=> Qxy /eqP; apply: contraTP. Qed.

Lemma
contra_lePUsed by
  • mathcomp.analysis.topology_theory.edist

Source code
{} { : porderType disp1} [ : Prop] [ : T1] :
  (~ P -> (x < y)%O) -> (y <= x)%O -> P.
Proof.
move=> Pxy yx; apply/asboolP.
by apply: Order.POrderTheory.contra_leT yx => /asboolPn.
Qed.

Lemma
contra_ltPSource code
{} { : porderType disp1} [ : Prop] [ : T1] :
  (~ P -> (x <= y)%O) -> (y < x)%O -> P.
Proof.
move=> Pxy yx; apply/asboolP.
by apply: Order.POrderTheory.contra_ltT yx => /asboolPn.
Qed.

Lemma
wlog_negSource code
: (~ P -> P) -> P.
Proof.
by case: (PropB P); exact. Qed.

Lemma : injective not
Proof.
exact: can_inj notK. Qed.

Lemma
notLRUsed by
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.topology_theory.connected

Source code
: (P = (~ Q)) -> (~ P) = Q
Proof.
exact: canLR notK. Qed.

Lemma
notRLUsed by
  • mathcomp.analysis.topology_theory.connected

Source code
: (~ P) = Q -> P = (~ Q)
Proof.
exact: canRL notK. Qed.

Lemma
iff_notrSource code
 ( : Prop) : (P <-> ~ Q) <-> (~ P <-> Q).
Proof.
by split=> [/propext ->|/propext <-]; rewrite notK. Qed.

Lemma
iff_not2Used by
  • mathcomp.analysis.topology_theory.edist

Source code
 ( : Prop) : (~ P <-> ~ Q) <-> (P <-> Q).
Proof.
by split=> [/iff_notr|PQ]; [|apply/iff_notr]; rewrite notK. Qed.


Definition
predp

classicType : Type -> Type classicType is not universe polymorphic Arguments classicType T%_type_scope classicType is transparent Expands to: Constant mathcomp.classical.boolp.classicType Declared in library mathcomp.classical.boolp, line 397, characters 11-22 eclassicType : eqType -> Type eclassicType is not universe polymorphic Arguments eclassicType T eclassicType is transparent Expands to: Constant mathcomp.classical.boolp.eclassicType Declared in library mathcomp.classical.boolp, line 406, characters 11-23 canonical_of : forall [T U : Type], (U -> T) -> Type canonical_of is not universe polymorphic Arguments canonical_of [T U]%_type_scope sort%_function_scope canonical_of is transparent Expands to: Constant mathcomp.classical.boolp.canonical_of Declared in library mathcomp.classical.boolp, line 413, characters 11-23


Source code
:= T -> Prop.

Identity Coercion fun_of_pred : predp >-> Funclass.

Definition
relp

predp : Type -> Type predp is not universe polymorphic Arguments predp T%_type_scope predp is transparent Expands to: Constant mathcomp.classical.boolp.predp Declared in library mathcomp.classical.boolp, line 611, characters 11-16


Source code
:= T -> predp T.

Identity Coercion fun_of_rel : rel >-> Funclass.

Notation := (fun _ => False).
Notation := (fun _ => True).
Notation := (fun ( : predp _) => p1 x /\ p2 x).
Notation := (fun ( : predp _) => p1 x \/ p2 x).
Notation := (fun ( : predp _) => ~ p x).
Notation := (fun ( : predp _) => ~ p2 x /\ p1 x).
Notation := (fun  ( : predp _) => p (f x)).
Notation := (fun ( : relp _) => r1 x y \/ r2 x y).

Definition
pred0p

relp : Type -> Type relp is not universe polymorphic Arguments relp T%_type_scope relp is transparent Expands to: Constant mathcomp.classical.boolp.relp Declared in library mathcomp.classical.boolp, line 615, characters 11-15


Source code
 ( : Type) ( : predp T) : bool := `[<P =1 xpredp0>].
Prenex Implicits pred0p.

Lemma   ( : Type) ( : predp T) : reflect (P =1 xpredp0) (pred0p P).
Proof.
by apply: (iffP (asboolP _)). Qed.

Lemma
forallp_asboolPnUsed by
  • mathcomp.classical.filter
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.topology_theory.compact

Source code
{} { : T -> Prop} :
  reflect (forall : T, ~ P x) (~~ `[<exists : T, P x>]).
Proof.
apply: (iffP idP)=> [/asboolPn NP x Px|NP].
by apply/NP; exists x. by apply/asboolP=> -[x]; apply/NP.
Qed.

Lemma
existsp_asboolPnUsed by
  • mathcomp.experimental_reals.realsum
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
{} { : T -> Prop} :
  reflect (exists : T, ~ P x) (~~ `[<forall : T, P x>]).
Proof.
apply: (iffP idP); last by case=> x NPx; apply/asboolPn=> /(_ x).
move/asboolPn=> NP; apply/asboolP/negbNE/asboolPn=> h.
by apply/NP=> x; apply/asboolP/negbNE/asboolPn=> NPx; apply/h; exists x.
Qed.

Lemma
asbool_forallNbSource code
{ : Type} ( : pred T) :
  `[< forall : T, ~~ (P x) >] = ~~ `[< exists : T, P x >].
Proof.
apply: (asbool_equiv_eqP forallp_asboolPn);
  by split=> h x; apply/negP/h.
Qed.

Lemma
asbool_existsNbSource code
{ : Type} ( : pred T) :
  `[< exists : T, ~~ (P x) >] = ~~ `[< forall : T, P x >].
Proof.
apply: (asbool_equiv_eqP existsp_asboolPn);
  by split=> -[x h]; exists x; apply/negP.
Qed.

Lemma
not_implyPUsed by
  • mathcomp.reals.reals
  • mathcomp.classical.set_interval
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.measure_theory.measure_negligible
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.normedtype_theory.vitali_lemma

Source code
 ( : Prop) : ~ (P -> Q) <-> P /\ ~ Q.
Proof.
split=> [/asboolP|[p nq pq]]; [|exact/nq/pq].
by rewrite asbool_neg => /imply_asboolPn.
Qed.

Lemma
not_andEUsed by
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.topology_theory.topology_structure

Source code
 ( : Prop) : (~ (P /\ Q)) = (~ P \/ ~ Q).
Proof.
eqProp=> [/asboolPn|[|]]; try by apply: contra_not => -[].
by rewrite asbool_and negb_and => /orP[]/asboolPn; [left|right].
Qed.

Lemma
not_andPUsed by
  • mathcomp.classical.fsbigop
  • mathcomp.classical.classical_orders
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.cantor
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.borel_hierarchy
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.elementary_functions.trigonometry_functions

Source code
 ( : Prop) : ~ (P /\ Q) <-> ~ P \/ ~ Q.
Proof.
by rewrite not_andE. Qed.

Lemma
not_and3PUsed by
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
 ( : Prop) : ~ [/\ P, Q & R] <-> [\/ ~ P, ~ Q | ~ R].
Proof.
split=> [/and3_asboolP|/or3_asboolP].
by rewrite 2!negb_and -3!asbool_neg => /or3_asboolP.
by rewrite 3!asbool_neg -2!negb_and => /and3_asboolP.
Qed.

Lemma
not_notPUsed by
  • mathcomp.analysis.sequences
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
 ( : Prop) : ~ ~ P <-> P.
Proof.
by split => [|p]; [exact: contrapT|exact]. Qed.
#[deprecated(since="mathcomp-analysis 1.15.0", note="Renamed to `not_notP`. Warning: a different `notP` is provided by `contra.v`.")]
Notation := not_notP (only parsing).

Lemma
not_notEUsed by
  • mathcomp.analysis.topology_theory.edist

Source code
 ( : Prop) : (~ ~ P) = P.
Proof.
by rewrite propeqE not_notP. Qed.
#[deprecated(since="mathcomp-analysis 1.15.0", note="Renamed to `not_notE`. Warning: a different `notE` is provided by `contra.v`.")]
Notation
notEUsed by
  • mathcomp.classical.classical_sets

Source code
:= not_notE (only parsing).

Lemma
not_orEUsed by
  • mathcomp.classical.contra

Source code
 ( : Prop) : (~ (P \/ Q)) = (~ P /\ ~ Q).
Proof.
by rewrite -[_ /\ _]not_notE not_andE 2!not_notE. Qed.

Lemma
not_orPUsed by
  • mathcomp.classical.cardinality
  • mathcomp.analysis.lebesgue_measure
  • mathcomp.analysis.ereal
  • mathcomp.analysis.measurable_realfun
  • mathcomp.analysis.derive
  • mathcomp.analysis.topology_theory.one_point_compactification
  • mathcomp.analysis.measure_theory.measurable_structure

Source code
 ( : Prop) : ~ (P \/ Q) <-> ~ P /\ ~ Q.
Proof.
by rewrite not_orE. Qed.

Lemma
not_implyEUsed by
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.realfun

Source code
 ( : Prop) : (~ (P -> Q)) = (P /\ ~ Q).
Proof.
by rewrite propeqE not_implyP. Qed.

Lemma
implyEUsed by
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.edist

Source code
 ( : Prop) : (P -> Q) = (~ P \/ Q).
Proof.

Lemma
orCUsed by
  • mathcomp.reals.reals
  • mathcomp.analysis.topology_theory.topology_structure

Source code
: commutative or.
Proof.
by move=> /PropB[] /PropB[] => //; rewrite !orB. Qed.

Lemma
orAUsed by
  • mathcomp.classical.classical_sets

Source code
: associative or.
Proof.
by move=> P Q R; rewrite propeqE; split=> [|]; tauto. Qed.

Lemma : left_commutative or.
Proof.
by move=> P Q R; rewrite !orA (orC P). Qed.

Lemma : right_commutative or.
Proof.
by move=> P Q R; rewrite -!orA (orC Q). Qed.

Lemma : interchange or or.
Proof.
by move=> P Q R S; rewrite !orA (orAC P). Qed.

Lemma
orNpUsed by
  • mathcomp.classical.contra

Source code
: (~ P \/ Q) = (P -> Q).
Proof.
by case/PropB: P; rewrite notB orB implyB. Qed.

Lemma : (P \/ ~ Q) = (Q -> P)
Proof.
by rewrite orC orNp. Qed.

Lemma
or3EUsed by
  • mathcomp.classical.contra

Source code
: [\/ P, Q | R] = (P \/ Q \/ R).
Proof.
rewrite -(asboolE P) -(asboolE Q) -(asboolE R) (reflect_eq or3P).
by rewrite -2!(reflect_eq orP).
Qed.

Lemma
or4EUsed by
  • mathcomp.classical.contra
  • mathcomp.classical.classical_sets

Source code
: [\/ P, Q, R | S] = (P \/ Q \/ R \/ S).
Proof.
rewrite -(asboolE P) -(asboolE Q) -(asboolE R) -(asboolE S) (reflect_eq or4P).
by rewrite -3!(reflect_eq orP).
Qed.

Lemma
andCUsed by
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
: commutative and.
Proof.
by move=> /PropB[] /PropB[]; rewrite !andB. Qed.

Lemma
andAUsed by
  • mathcomp.analysis.esum

Source code
: associative and.
Proof.
by move=> P Q R; rewrite propeqE; split=> [|]; tauto. Qed.

Lemma : left_commutative and.
Proof.
by move=> P Q R; rewrite !andA (andC P). Qed.

Lemma : right_commutative and.
Proof.
by move=> P Q R; rewrite -!andA (andC Q). Qed.

Lemma : interchange and and.
Proof.
by move=> P Q R S; rewrite !andA (andAC P). Qed.

Lemma
and3EUsed by
  • mathcomp.classical.contra
  • mathcomp.analysis.topology_theory.topology_structure

Source code
: [/\ P, Q & R] = (P /\ Q /\ R).
Proof.
by eqProp=> [[] | [? []]]. Qed.

Lemma
and4EUsed by
  • mathcomp.classical.contra

Source code
: [/\ P, Q, R & S] = (P /\ Q /\ R /\ S).
Proof.
by eqProp=> [[] | [? [? []]]]. Qed.

Lemma
and5EUsed by
  • mathcomp.classical.contra

Source code
: [/\ P, Q, R, S & T] = (P /\ Q /\ R /\ S /\ T).
Proof.
by eqProp=> [[] | [? [? [? []]]]]. Qed.

Lemma
implyNpUsed by
  • mathcomp.classical.contra
  • mathcomp.analysis.topology_theory.topology_structure

Source code
: (~ P -> Q : Prop) = (P \/ Q).
Proof.
by rewrite -orNp notK. Qed.

Lemma
implypNUsed by
  • mathcomp.classical.contra
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : Prop) : (P -> ~ Q) = (~ (P /\ Q)).
Proof.
by case/PropB: P; rewrite implyB andB ?notB. Qed.

Lemma
implyNNUsed by
  • mathcomp.classical.contra

Source code
: (~ P -> ~ Q) = (Q -> P).
Proof.
by rewrite implyNp orpN. Qed.

Lemma : right_distributive or and.
Proof.
by case/PropB=> Q R; rewrite !orB ?andB. Qed.

Lemma : left_distributive or and.
Proof.
by move=> P Q R; rewrite -!(orC R) or_andr. Qed.

Lemma : right_distributive and or.
Proof.
by move=> P Q R; apply/not_inj; rewrite !(not_andE, not_orE) or_andr. Qed.

Lemma : left_distributive and or.
Proof.
by move=> P Q R; apply/not_inj; rewrite !(not_andE, not_orE) or_andl. Qed.

Lemma
forallNEUsed by
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.measure_theory.measure_extension
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
{} ( : T -> Prop) : (forall , ~ P x) = (~ exists , P x).
Proof.
by rewrite propeqE; split => [fP [x /fP]//|nexP x Px]; apply: nexP; exists x.
Qed.

Lemma
existsNEUsed by
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
{} ( : T -> Prop) : (exists , ~ P x) = (~ forall , P x).
Proof.
rewrite propeqE; split=> [[x Px] aP //|NaP].
by apply: contrapT; rewrite -forallNE => aP; apply: NaP => x; apply: contrapT.
Qed.

Lemma
existsNPUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.sequences
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.realfun
  • mathcomp.analysis.measure_theory.measure_negligible
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.vitali_lemma

Source code
 ( : T -> Prop) : (exists , ~ P x) <-> ~ forall , P x.
Proof.
by rewrite existsNE. Qed.

Lemma
not_existsPUsed by
  • mathcomp.analysis.showcase.pnt
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.separation_axioms

Source code
 ( : T -> Prop) : (exists , P x) <-> ~ forall , ~ P x.
Proof.
by rewrite forallNE notK. Qed.

Lemma
forallNPUsed by
  • mathcomp.classical.set_interval
  • mathcomp.classical.classical_sets
  • mathcomp.analysis.cantor
  • mathcomp.analysis.sequences
  • mathcomp.analysis.topology_theory.connected
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.order_topology
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.analysis.realfun
  • mathcomp.analysis.kernel
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.normedtype_theory.normed_module
  • mathcomp.analysis.normedtype_theory.vitali_lemma
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : T -> Prop) : (forall , ~ P x) <-> ~ exists , P x.
Proof.
by rewrite forallNE. Qed.

Lemma
not_forallPUsed by
  • mathcomp.reals.reals
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
  • mathcomp.analysis.measure_theory.signed_measure
  • mathcomp.analysis.measure_theory.counting_measure

Source code
 ( : T -> Prop) : (forall , P x) <-> ~ exists , ~ P x.
Proof.
by rewrite existsNE notK. Qed.

Lemma
exists2EUsed by
  • mathcomp.classical.contra
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.subspace_topology

Source code
: (exists2 : A, P x & Q x) = (exists , P x /\ Q x).
Proof.
by eqProp=> -[x]; last case; exists x. Qed.

Lemma
exists2PUsed by
  • mathcomp.analysis_stdlib.showcase.uniform_bigO
  • mathcomp.analysis.topology_theory.initial_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.matrix_topology
  • mathcomp.analysis.topology_theory.compact
  • mathcomp.analysis.topology_theory.uniform_structure
  • mathcomp.analysis.realfun

Source code
 ( : T -> Prop) :
  (exists2 , P x & Q x) <-> exists , P x /\ Q x.
Proof.
by rewrite exists2E. Qed.

Lemma
not_exists2PUsed by
  • mathcomp.reals.reals
  • mathcomp.classical.functions
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal

Source code
 ( : T -> Prop) :
  (exists2 , P x & Q x) <-> ~ forall , ~ P x \/ ~ Q x.
Proof.
rewrite exists2P not_existsP.
by split; apply: contra_not => PQx x;  apply/not_andP; apply: PQx.
Qed.

Lemma
forall2NPUsed by
  • mathcomp.experimental_reals.discrete
  • mathcomp.classical.fsbigop
  • mathcomp.classical.classical_orders
  • mathcomp.analysis.esum
  • mathcomp.analysis.sequences
  • mathcomp.analysis.ereal
  • mathcomp.analysis.borel_hierarchy
  • mathcomp.analysis.topology_theory.topology_structure
  • mathcomp.analysis.topology_theory.edist
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.normedtype_theory.vitali_lemma

Source code
 ( : T -> Prop) :
  (forall , ~ P x \/ ~ Q x) <-> ~ (exists2 , P x & Q x).
Proof.
split=> [PQ [t Pt Qt]|PQ t]; first by have [] := PQ t.
by rewrite -not_andP => -[Pt Qt]; apply PQ; exists t.
Qed.

Lemma
forallPNPUsed by
  • mathcomp.analysis.topology_theory.pseudometric_structure
  • mathcomp.analysis.topology_theory.num_topology

Source code
 ( : T -> Prop) :
  (forall , P x -> ~ Q x) <-> ~ (exists2 , P x & Q x).
Proof.
split=> [PQ [t Pt Qt]|PQ t]; first by have [] := PQ t.
by move=> Pt Qt; apply: PQ; exists t.
Qed.

Lemma
existsPNPUsed by
  • mathcomp.classical.fsbigop
  • mathcomp.analysis.ereal
  • mathcomp.analysis.topology_theory.separation_axioms
  • mathcomp.analysis.realfun
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
 ( : T -> Prop) :
  (exists2 , P x & ~ Q x) <-> ~ (forall , P x -> Q x).
Proof.
split=> [[x Px NQx] /(_ x Px)//|]; apply: contra_notP => + x Px.
by apply: contra_notP => NQx; exists x.
Qed.

Lemma
forallp_asboolPn2Used by
  • mathcomp.analysis.topology_theory.topology_structure

Source code
{} { : T -> Prop} :
  reflect (forall : T, ~ P x \/ ~ Q x) (~~ `[<exists2 : T, P x & Q x>]).
Proof.
apply: (iffP idP)=> [/asboolPn NP x|NP].
  by move/forallPNP : NP => /(_ x)/and_rec/not_andP.
by apply/asboolP=> -[x Px Qx]; have /not_andP := NP x; exact.
Qed.

Section bigmaxmin.
Local Notation := Order.max.
Local Notation := Order.min.
Local Open Scope order_scope.
Context {} { : orderType d} ( : T)
  { : finType} ( : pred I) ( : T) ( : I -> T).

Import Order.TTheory.

Lemma
bigmax_gePUsed by
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.normedtype_theory.matrix_normedtype

Source code
: reflect (m <= x \/ exists2 , P i & m <= F i)
                           (m <= \big[max/x]_( | P i) F i).
Proof.
apply: (iffP idP) => [|[mx|[i Pi mFi]]].
- rewrite leNgt => /bigmax_ltP /not_andP[/negP|]; first by rewrite -leNgt; left.
  by move=> /existsNP[i /not_implyP[Pi /negP]]; rewrite -leNgt; right; exists i.
- by rewrite bigmax_idl le_max mx.
- by rewrite (bigmaxD1 i)// le_max mFi.
Qed.

Lemma
bigmax_gtPSource code
: reflect (m < x \/ exists2 , P i & m < F i)
                           (m < \big[max/x]_( | P i) F i).
Proof.
apply: (iffP idP) => [|[mx|[i Pi mFi]]].
- rewrite ltNge => /bigmax_leP /not_andP[/negP|]; first by rewrite -ltNge; left.
  by move=> /existsNP[i /not_implyP[Pi /negP]]; rewrite -ltNge; right; exists i.
- by rewrite bigmax_idl lt_max mx.
- by rewrite (bigmaxD1 i)// lt_max mFi.
Qed.

Lemma
bigmin_lePUsed by
  • mathcomp.analysis.lebesgue_measure

Source code
: reflect (x <= m \/ exists2 , P i & F i <= m)
                           (\big[min/x]_( | P i) F i <= m).
Proof.
apply: (iffP idP) => [|[xm|[i Pi Fim]]].
- rewrite leNgt => /bigmin_gtP /not_andP[/negP|]; first by rewrite -leNgt; left.
  by move=> /existsNP[i /not_implyP[Pi /negP]]; rewrite -leNgt; right; exists i.
- by rewrite bigmin_idl ge_min xm.
- by rewrite (bigminD1 i)// ge_min Fim.
Qed.

Lemma
bigmin_ltPSource code
: reflect (x < m \/ exists2 , P i & F i < m)
                           (\big[min/x]_( | P i) F i < m).
Proof.
apply: (iffP idP) => [|[xm|[i Pi Fim]]].
- rewrite ltNge => /bigmin_geP /not_andP[/negP|]; first by rewrite -ltNge; left.
  by move=> /existsNP[i /not_implyP[Pi /negP]]; rewrite -ltNge; right; exists i.
- by rewrite bigmin_idl gt_min xm.
- by rewrite (bigminD1 _ _ _ Pi) gt_min Fim.
Qed.

End bigmaxmin.

Module
FunOrderSource code
.
Section FunOrder.
Import Order.TTheory.
Context { : Type} {} { : porderType d}.
Implicit Types f g h : aT -> T.

Lemma
fun_displaySource code
: Order.disp_t
Proof.
exact: Order.default_display. Qed.

Definition
lef

FunOrder.lef : forall {aT : Type} {d : disp_t} {T : porderType d}, (aT -> T) -> (aT -> T) -> bool FunOrder.lef is not universe polymorphic Arguments FunOrder.lef {aT}%_type_scope {d T} (f g)%_function_scope FunOrder.lef is transparent Expands to: Constant mathcomp.classical.boolp.FunOrder.lef Declared in library mathcomp.classical.boolp, line 909, characters 11-14


Source code
:= `[< forall , (f x <= g x)%O >].
Local Notation 
"f <= g"Source code
:= (lef f g).

Definition
ltf

FunOrder.ltf : forall {aT : Type} {d : disp_t} {T : porderType d}, (aT -> T) -> (aT -> T) -> bool FunOrder.ltf is not universe polymorphic Arguments FunOrder.ltf {aT}%_type_scope {d T} (f g)%_function_scope FunOrder.ltf is transparent Expands to: Constant mathcomp.classical.boolp.FunOrder.ltf Declared in library mathcomp.classical.boolp, line 912, characters 11-14


Source code
:= `[< (forall , (f x <= g x)%O) /\ exists , f x != g x >].
Local Notation  := (ltf f g).

Lemma : (f < g) = (g != f) && (f <= g).
Proof.
apply/idP/andP => [fg|[gf fg]]; [split|apply/asboolP; split; [exact/asboolP|]].
- by apply/eqP => gf; move: fg => /asboolP[fg] [x /eqP]; apply; rewrite gf.
- apply/asboolP => x; rewrite le_eqVlt; move/asboolP : fg => [fg [y gfy]].
  by have [//|gfx /=] := boolP (f x == g x); rewrite lt_neqAle gfx /= fg.
- apply/not_existsP => h.
  have : f =1 g by move=> x; have /negP/negPn/eqP := h x.
  by rewrite -funeqE; apply/nesym/eqP.
Qed.

Fact
lef_reflSource code
: reflexive lef
Proof.
by move=> f; apply/asboolP => x. Qed.

Fact
lef_antiSource code
: antisymmetric lef.
Proof.
move=> f g => /andP[/asboolP fg /asboolP gf]; rewrite funeqE => x.
by apply/eqP; rewrite eq_le fg gf.
Qed.

Fact
lef_transSource code
: transitive lef.
Proof.
move=> g f h /asboolP fg /asboolP gh; apply/asboolP => x.
by rewrite (le_trans (fg x)).
Qed.

#[export]Source code

.
instanceSource code
DefinitionSource code
.isPOrder.Build
  fun_display (aT -> T) lef ltf ltf_def lef_refl lef_anti lef_trans.

End FunOrder.

Section FunLattice.
Import Order.TTheory.
Context { : Type} {} { : latticeType d}.
Implicit Types f g h : aT -> T.

Definition
meetf

FunOrder.meetf : forall {aT : Type} {d : disp_t} {T : latticeType d}, (aT -> T) -> (aT -> T) -> aT -> T FunOrder.meetf is not universe polymorphic Arguments FunOrder.meetf {aT}%_type_scope {d T} (f g)%_function_scope x FunOrder.meetf is transparent Expands to: Constant mathcomp.classical.boolp.FunOrder.meetf Declared in library mathcomp.classical.boolp, line 951, characters 11-16


Source code
:= fun => Order.meet (f x) (g x).
Definition
joinf

FunOrder.joinf : forall {aT : Type} {d : disp_t} {T : latticeType d}, (aT -> T) -> (aT -> T) -> aT -> T FunOrder.joinf is not universe polymorphic Arguments FunOrder.joinf {aT}%_type_scope {d T} (f g)%_function_scope x FunOrder.joinf is transparent Expands to: Constant mathcomp.classical.boolp.FunOrder.joinf Declared in library mathcomp.classical.boolp, line 952, characters 11-16


Source code
:= fun => Order.join (f x) (g x).

Lemma : commutative meetf.
Proof.
move=> f g; apply/funext => x; exact: meetC. Qed.

Lemma : commutative joinf.
Proof.
move=> f g; apply/funext => x; exact: joinC. Qed.

Lemma : associative meetf.
Proof.
move=> f g h; apply/funext => x; exact: meetA. Qed.

Lemma : associative joinf.
Proof.
move=> f g h; apply/funext => x; exact: joinA. Qed.

Lemma : meetf f (joinf f g) = f.
Proof.
apply/funext => x; exact: joinKI. Qed.

Lemma : joinf f (meetf f g) = f.
Proof.
apply/funext => x; exact: meetKU. Qed.

Lemma
lef_meetSource code
: (f <= g)%O = (meetf f g == f).
Proof.
apply/idP/idP => [/asboolP f_le_g|/eqP <-].
- apply/eqP/funext => x; exact/meet_l/f_le_g.
- apply/asboolP => x; exact: leIr.
Qed.

#[export]Source code

.
instanceSource code
DefinitionSource code
.POrder_isLattice.Build _ (aT -> T)
  meetfC joinfC meetfA joinfA joinfKI meetfKU lef_meet.

End FunLattice.
Module .
HB.reexport.
End Exports.
End FunOrder.
Export FunOrder.Exports.

Lemma
lefPUsed by
  • mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
  • mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
  • mathcomp.analysis.lebesgue_integral_theory.giry
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
  • mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
  • mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
  • mathcomp.analysis.probability_theory.independence
  • mathcomp.analysis.probability_theory.uniform_distribution
  • mathcomp.analysis.kernel

Source code
 ( : Type)  ( : porderType d) ( : aT -> T) :
  reflect (forall , (f x <= g x)%O) (f <= g)%O.
Proof.
by apply: (iffP idP) => [fg|fg]; [exact/asboolP | exact/asboolP]. Qed.

Lemma  ( : Type)  ( : latticeType d) ( : aT -> T) :
  ((f `&` g) x = f x `&` g x)%O.
Proof.
by []. Qed.

Lemma  ( : Type)  ( : latticeType d) ( : aT -> T) :
  ((f `|` g) x = f x `|` g x)%O.
Proof.
by []. Qed.

Lemma
iterfSUsed by
  • mathcomp.classical.functions

Source code
{} ( : T -> T) : iter n.+1 f = f \o iter n f.
Proof.
by []. Qed.

Lemma
iterfSrUsed by
  • mathcomp.classical.functions

Source code
{} ( : T -> T) : iter n.+1 f = iter n f \o f.
Proof.
by apply/funeqP => ?; rewrite iterSr. Qed.

Lemma {} ( : T -> T) : iter 0 f = id.
Proof.
by []. Qed.

Section Inhabited.
Context ( : Type).

Lemma
inhabitedEUsed by
  • mathcomp.classical.contra

Source code
: inhabited T = exists : T, True.
Proof.
by eqProp; case. Qed.

Lemma
inhabited_witnessUsed by
  • mathcomp.classical.contra

Source code
: inhabited T -> T.
Proof.
by rewrite inhabitedE => /cid[]. Qed.

End Inhabited.

Lemma
uncurryKUsed by
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
{ : Type} : cancel (@uncurry X Y Z) curry.
Proof.
by move=> f; rewrite funeq2E. Qed.

Lemma { : Type} : cancel curry (@uncurry X Y Z).
Proof.
by move=> f; rewrite funeqE=> -[]. Qed.