text
stringlengths 0
3.34M
|
---|
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ P (Scheme.Ξ.map (f β£_ Scheme.basicOpen Y r).op) β
P
(IsLocalization.Away.map (β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
(β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))) (Scheme.Ξ.map f.op) r)
[PROOFSTEP]
rw [Ξ_map_morphismRestrict, hP.cancel_left_isIso, hP.cancel_right_isIso, β
hP.cancel_right_isIso (f.val.c.app (Opposite.op (Y.basicOpen r)))
(X.presheaf.map (eqToHom (Scheme.preimage_basicOpen f r).symm).op),
β eq_iff_iff]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ P
(NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β«
X.presheaf.map
(eqToHom
(_ :
Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) =
(Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op) =
P
(IsLocalization.Away.map (β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
(β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))) (Scheme.Ξ.map f.op) r)
[PROOFSTEP]
congr
[GOAL]
case e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β«
X.presheaf.map
(eqToHom
(_ :
Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) =
(Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op =
IsLocalization.Away.map (β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
(β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))) (Scheme.Ξ.map f.op) r
[PROOFSTEP]
delta IsLocalization.Away.map
[GOAL]
case e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β«
X.presheaf.map
(eqToHom
(_ :
Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) =
(Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op =
IsLocalization.map (β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
(Scheme.Ξ.map f.op)
(_ : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r)))
[PROOFSTEP]
refine' IsLocalization.ringHom_ext (Submonoid.powers r) _
[GOAL]
case e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ comp
(NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β«
X.presheaf.map
(eqToHom
(_ :
Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) =
(Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op)
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
comp
(IsLocalization.map (β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
(Scheme.Ξ.map f.op)
(_ : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))))
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
[PROOFSTEP]
generalize_proofs h1 h2 h3
[GOAL]
case e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
h1 : Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
h3 : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))
β’ comp (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β« X.presheaf.map (eqToHom h1).op)
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
comp
(IsLocalization.map (β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
(Scheme.Ξ.map f.op) h3)
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
[PROOFSTEP]
haveI i1 :=
@isLocalization_away_of_isAffine X _
(Scheme.Ξ.map f.op r)
-- Porting note : needs to be very explicit here
[GOAL]
case e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
h1 : Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
h3 : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))
i1 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
β’ comp (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β« X.presheaf.map (eqToHom h1).op)
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
comp
(IsLocalization.map (β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
(Scheme.Ξ.map f.op) h3)
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
[PROOFSTEP]
convert
(@IsLocalization.map_comp (hy := h3) (Y.presheaf.obj <| Opposite.op (Scheme.basicOpen Y r)) _ _
(isLocalization_away_of_isAffine _) _ _ _ i1).symm using
1
[GOAL]
case h.e'_2.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
h1 : Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
h3 : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))
i1 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
e_1β :
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r))))) =
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
β’ comp (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β« X.presheaf.map (eqToHom h1).op)
(algebraMap β(Y.presheaf.obj (Opposite.op β€)) β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
comp
(algebraMap ((fun x => β(X.presheaf.obj (Opposite.op β€))) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
(Scheme.Ξ.map f.op)
[PROOFSTEP]
change Y.presheaf.map _ β« _ = _ β« X.presheaf.map _
[GOAL]
case h.e'_2.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
h1 : Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
h3 : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))
i1 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
e_1β :
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r))))) =
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
β’ Y.presheaf.map (homOfLE (_ : RingedSpace.basicOpen Y.toSheafedSpace r β€ β€)).op β«
NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) β« X.presheaf.map (eqToHom h1).op =
Scheme.Ξ.map f.op β«
X.presheaf.map (homOfLE (_ : RingedSpace.basicOpen X.toSheafedSpace (β(Scheme.Ξ.map f.op) r) β€ β€)).op
[PROOFSTEP]
rw [f.val.c.naturality_assoc]
[GOAL]
case h.e'_2.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
h1 : Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
h3 : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))
i1 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
e_1β :
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r))))) =
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
β’ NatTrans.app f.val.c (Opposite.op β€) β«
(f.val.base _* X.presheaf).map (homOfLE (_ : RingedSpace.basicOpen Y.toSheafedSpace r β€ β€)).op β«
X.presheaf.map (eqToHom h1).op =
Scheme.Ξ.map f.op β«
X.presheaf.map (homOfLE (_ : RingedSpace.basicOpen X.toSheafedSpace (β(Scheme.Ξ.map f.op) r) β€ β€)).op
[PROOFSTEP]
erw [β X.presheaf.map_comp]
[GOAL]
case h.e'_2.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
h1 : Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
h3 : Submonoid.powers r β€ Submonoid.comap (Scheme.Ξ.map f.op) (Submonoid.powers (β(Scheme.Ξ.map f.op) r))
i1 :
IsLocalization.Away (β(Scheme.Ξ.map f.op) r)
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))
e_1β :
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r))))) =
(β(Y.presheaf.obj (Opposite.op β€)) β+*
β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)))))
β’ NatTrans.app f.val.c (Opposite.op β€) β«
X.presheaf.map
((Opens.map f.val.base).op.map (homOfLE (_ : RingedSpace.basicOpen Y.toSheafedSpace r β€ β€)).op β«
(eqToHom h1).op) =
Scheme.Ξ.map f.op β«
X.presheaf.map (homOfLE (_ : RingedSpace.basicOpen X.toSheafedSpace (β(Scheme.Ξ.map f.op) r) β€ β€)).op
[PROOFSTEP]
congr 1
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ P (Scheme.Ξ.map (f β£_ Scheme.basicOpen Y r).op) β P (Localization.awayMap (Scheme.Ξ.map f.op) r)
[PROOFSTEP]
refine
(hP.basicOpen_iff _ _).trans
?_
-- Porting note : was a one line term mode proof, but this `dsimp` is vital so the term mode
-- one liner is not possible
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ P
(IsLocalization.Away.map (β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
(β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r))))) (Scheme.Ξ.map f.op) r) β
P (Localization.awayMap (Scheme.Ξ.map f.op) r)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβΒΉ : IsAffine X
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
β’ P
(IsLocalization.Away.map (β(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
(β(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r)))))
(NatTrans.app f.val.c (Opposite.op β€)) r) β
P (Localization.awayMap (NatTrans.app f.val.c (Opposite.op β€)) r)
[PROOFSTEP]
rw [β hP.is_localization_away_iff]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
V :
Opens
ββ(Scheme.restrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
e :
V =
(Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ : OpenEmbedding β(Opens.inclusion V)) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
subst e
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
letI a1 :
Algebra (Scheme.Ξ.obj (Opposite.op Y)) (Scheme.Ξ.obj (Opposite.op (Y.restrict (Y.basicOpen r).openEmbedding))) :=
ΞRestrictAlgebra _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
let U' :=
((Opens.map (X.ofRestrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).val.base).obj U).openEmbedding
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
letI a2 :
Algebra (Scheme.Ξ.obj (Opposite.op (X.restrict U.openEmbedding)))
(Scheme.Ξ.obj <|
Opposite.op <| (X.restrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).restrict U') :=
by
apply RingHom.toAlgebra
refine X.presheaf.map (@homOfLE _ _ ((IsOpenMap.functor _).obj _) ((IsOpenMap.functor _).obj _) ?_).op
rw [β SetLike.coe_subset_coe, Functor.op_obj]
dsimp [Opens.inclusion]
simp only [Set.image_univ, Set.image_subset_iff, Subtype.range_val]
rw [ContinuousMap.coe_mk, Subtype.range_val, ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val]
rfl
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
[PROOFSTEP]
apply RingHom.toAlgebra
[GOAL]
case i
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U))))) β+*
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
[PROOFSTEP]
refine X.presheaf.map (@homOfLE _ _ ((IsOpenMap.functor _).obj _) ((IsOpenMap.functor _).obj _) ?_).op
[GOAL]
case i
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop
[PROOFSTEP]
rw [β SetLike.coe_subset_coe, Functor.op_obj]
[GOAL]
case i
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ β((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
(Opposite.op
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).obj
(Opposite.op β€).unop)).unop) β
β((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)
[PROOFSTEP]
dsimp [Opens.inclusion]
[GOAL]
case i
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ β(ContinuousMap.mk Subtype.val) '' (β(ContinuousMap.mk Subtype.val) '' Set.univ) β
β(ContinuousMap.mk Subtype.val) '' Set.univ
[PROOFSTEP]
simp only [Set.image_univ, Set.image_subset_iff, Subtype.range_val]
[GOAL]
case i
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ Set.range β(ContinuousMap.mk Subtype.val) β
β(ContinuousMap.mk Subtype.val) β»ΒΉ' Set.range β(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [ContinuousMap.coe_mk, Subtype.range_val, ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val]
[GOAL]
case i
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
β’ β((Opens.map (ContinuousMap.mk Subtype.val)).obj U) β Subtype.val β»ΒΉ' βU
[PROOFSTEP]
rfl
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
have i1 := AlgebraicGeometry.Ξ_restrict_isLocalization Y r
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
have i2 :
IsLocalization.Away ((Scheme.Ξ.map (X.ofRestrict U.openEmbedding β« f).op) r)
(Scheme.Ξ.obj <|
Opposite.op <| (X.restrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).restrict U') :=
by
rw [β U.openEmbedding_obj_top] at hU
dsimp [Scheme.Ξ_obj_op, Scheme.Ξ_map_op, Scheme.restrict]
apply AlgebraicGeometry.isLocalization_of_eq_basicOpen _ hU
rw [Opens.openEmbedding_obj_top, Opens.functor_obj_map_obj]
convert (X.basicOpen_res (Scheme.Ξ.map f.op r) (homOfLE le_top).op).symm using 1
rw [Opens.openEmbedding_obj_top, Opens.openEmbedding_obj_top, inf_comm, Scheme.Ξ_map_op]
-- Porting note : changed `rw` to `erw`
erw [β Scheme.preimage_basicOpen]
-- Porting note : have to add many explicit variables
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
[PROOFSTEP]
rw [β U.openEmbedding_obj_top] at hU
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€)
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
[PROOFSTEP]
dsimp [Scheme.Ξ_obj_op, Scheme.Ξ_map_op, Scheme.restrict]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€)
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ IsLocalization.Away
(β(NatTrans.app f.val.c (Opposite.op β€) β«
X.presheaf.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion U))).counit
((Opens.map f.val.base).obj β€)).op)
r)
β(X.presheaf.obj
(Opposite.op
((IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map (Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).obj
U)))).obj
β€))))
[PROOFSTEP]
apply AlgebraicGeometry.isLocalization_of_eq_basicOpen _ hU
[GOAL]
case e
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€)
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map (Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).obj U)))).obj
β€) =
Scheme.basicOpen X
(β(NatTrans.app f.val.c (Opposite.op β€) β«
X.presheaf.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion U))).counit
((Opens.map f.val.base).obj β€)).op)
r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top, Opens.functor_obj_map_obj]
[GOAL]
case e
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€)
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj β€ β U =
Scheme.basicOpen X
(β(NatTrans.app f.val.c (Opposite.op β€) β«
X.presheaf.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion U))).counit
((Opens.map f.val.base).obj β€)).op)
r)
[PROOFSTEP]
convert (X.basicOpen_res (Scheme.Ξ.map f.op r) (homOfLE le_top).op).symm using 1
[GOAL]
case h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€)
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj β€ β U =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€ β Scheme.basicOpen X (β(Scheme.Ξ.map f.op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top, Opens.openEmbedding_obj_top, inf_comm, Scheme.Ξ_map_op]
-- Porting note : changed `rw` to `erw`
[GOAL]
case h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj β€)
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
β’ U β (Opens.map f.val.base).obj (Scheme.basicOpen Y r) =
U β Scheme.basicOpen X (β(NatTrans.app f.val.c (Opposite.op β€)) r)
[PROOFSTEP]
erw [β Scheme.preimage_basicOpen]
-- Porting note : have to add many explicit variables
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
have :=
@RespectsIso.is_localization_away_iff (hP := hP) (R := Scheme.Ξ.obj <| Opposite.op Y) (S :=
Scheme.Ξ.obj (Opposite.op (X.restrict U.openEmbedding))) (R' :=
Scheme.Ξ.obj (Opposite.op (Y.restrict (Y.basicOpen r).openEmbedding))) (S' :=
Scheme.Ξ.obj <| Opposite.op <| (X.restrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).restrict U')
_ _ _ _ _ _ (Scheme.Ξ.map (X.ofRestrict U.openEmbedding β« f).op) r
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) β
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
rw [this, iff_iff_eq]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op) =
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
[PROOFSTEP]
congr 1
[GOAL]
case e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op =
IsLocalization.Away.map
(β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r
[PROOFSTEP]
apply IsLocalization.ringHom_ext (R := Scheme.Ξ.obj (Opposite.op Y)) (Submonoid.powers r) _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ comp
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op)
(algebraMap β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))) =
comp
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
(algebraMap β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
[PROOFSTEP]
rw [IsLocalization.Away.map, IsLocalization.map_comp, RingHom.algebraMap_toAlgebra]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ comp
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U))) β«
f β£_ Scheme.basicOpen Y r).op)
(Scheme.Ξ.map (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).op) =
comp
(algebraMap β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op)
[PROOFSTEP]
rw [op_comp, op_comp, Functor.map_comp, Functor.map_comp]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ comp
(Scheme.Ξ.map (f β£_ Scheme.basicOpen Y r).op β«
Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).op)
(Scheme.Ξ.map (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).op) =
comp
(algebraMap β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))))))
(Scheme.Ξ.map f.op β« Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U))).op)
[PROOFSTEP]
change _ = comp (X.presheaf.map _) _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ comp
(Scheme.Ξ.map (f β£_ Scheme.basicOpen Y r).op β«
Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).op)
(Scheme.Ξ.map (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).op) =
comp
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
(Scheme.Ξ.map f.op β« Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U))).op)
[PROOFSTEP]
refine' (@Category.assoc CommRingCat _ _ _ _ _ _ _ _).symm.trans _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ (Scheme.Ξ.map (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).op β«
Scheme.Ξ.map (f β£_ Scheme.basicOpen Y r).op) β«
Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).op =
comp
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
(Scheme.Ξ.map f.op β« Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U))).op)
[PROOFSTEP]
refine' Eq.trans _ (@Category.assoc CommRingCat _ _ _ _ _ _ _ _)
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ (Scheme.Ξ.map (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).op β«
Scheme.Ξ.map (f β£_ Scheme.basicOpen Y r).op) β«
Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).op =
(Scheme.Ξ.map f.op β« Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U))).op) β«
X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op
[PROOFSTEP]
dsimp only [Scheme.Ξ_map, Quiver.Hom.unop_op]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ (NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).val.c
(Opposite.op β€) β«
NatTrans.app (f β£_ Scheme.basicOpen Y r).val.c (Opposite.op β€)) β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).val.c
(Opposite.op β€) =
(NatTrans.app f.val.c (Opposite.op β€) β«
NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U))).val.c (Opposite.op β€)) β«
X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op
[PROOFSTEP]
rw [morphismRestrict_c_app, Category.assoc, Category.assoc, Category.assoc]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))).val.c
(Opposite.op β€) β«
NatTrans.app f.val.c
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen Y r)))).obj β€)) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((Opens.map (f β£_ Scheme.basicOpen Y r).val.base).obj β€) =
(Opens.map f.val.base).obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen Y r)))).obj β€))).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).val.c
(Opposite.op β€) =
NatTrans.app f.val.c (Opposite.op β€) β«
NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U))).val.c (Opposite.op β€) β«
X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op
[PROOFSTEP]
erw [f.1.c.naturality_assoc, β X.presheaf.map_comp, β X.presheaf.map_comp, β X.presheaf.map_comp]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RespectsIso P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (Opposite.op β€))
U : Opens ββX.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra β(Scheme.Ξ.obj (Opposite.op Y))
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
ΞRestrictAlgebra (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)) :=
Opens.openEmbedding
((Opens.map
(Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
U)
a2 : Algebra β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion U)))))
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))) :=
toAlgebra
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
i1 :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))
this :
β
[inst :
IsLocalization.Away r
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r))))))]
[inst_1 :
IsLocalization.Away (β(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U')))],
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r) β
P
(IsLocalization.Away.map
(β(Scheme.Ξ.obj
(Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen Y r)))))))
(β(Scheme.Ξ.obj
(Opposite.op
(Scheme.restrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
U'))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U)) β« f).op) r)
β’ NatTrans.app f.val.c (Opposite.op β€) β«
X.presheaf.map
((Opens.map f.val.base).op.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen Y r)))).counit
(Opposite.op β€).unop).op β«
(eqToHom
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((Opens.map (f β£_ Scheme.basicOpen Y r).val.base).obj β€) =
(Opens.map f.val.base).obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen Y r)))).obj β€))).op β«
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
U)))).counit
(Opposite.op β€).unop).op) =
NatTrans.app f.val.c (Opposite.op β€) β«
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion U))).counit (Opposite.op β€).unop).op β«
(homOfLE
(_ :
(IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj
(Scheme.basicOpen Y r))))).val.base).obj
U)))).op.obj
(Opposite.op β€)).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U))).obj (Opposite.op β€).unop)).op)
[PROOFSTEP]
congr 1
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
β’ P (Scheme.Ξ.map pullback.fst.op)
[PROOFSTEP]
erw [β PreservesPullback.iso_inv_fst AffineScheme.forgetToScheme (AffineScheme.ofHom f) (AffineScheme.ofHom g)]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
β’ P
(Scheme.Ξ.map
((PreservesPullback.iso AffineScheme.forgetToScheme (AffineScheme.ofHom f) (AffineScheme.ofHom g)).inv β«
AffineScheme.forgetToScheme.map pullback.fst).op)
[PROOFSTEP]
rw [op_comp, Functor.map_comp, hP'.cancel_right_isIso, AffineScheme.forgetToScheme_map]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
β’ P (Scheme.Ξ.map pullback.fst.op)
[PROOFSTEP]
have :=
_root_.congr_arg Quiver.Hom.unop
(PreservesPullback.iso_hom_fst AffineScheme.Ξ.rightOp (AffineScheme.ofHom f) (AffineScheme.ofHom g))
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
this :
((PreservesPullback.iso AffineScheme.Ξ.rightOp (AffineScheme.ofHom f) (AffineScheme.ofHom g)).hom β«
pullback.fst).unop =
(AffineScheme.Ξ.rightOp.map pullback.fst).unop
β’ P (Scheme.Ξ.map pullback.fst.op)
[PROOFSTEP]
simp only [Quiver.Hom.unop_op, Functor.rightOp_map, unop_comp] at this
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
this :
pullback.fst.unop β«
(PreservesPullback.iso AffineScheme.Ξ.rightOp (AffineScheme.ofHom f) (AffineScheme.ofHom g)).hom.unop =
AffineScheme.Ξ.map pullback.fst.op
β’ P (Scheme.Ξ.map pullback.fst.op)
[PROOFSTEP]
delta AffineScheme.Ξ at this
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
this :
pullback.fst.unop β«
(PreservesPullback.iso (AffineScheme.forgetToScheme.op β Scheme.Ξ).rightOp (AffineScheme.ofHom f)
(AffineScheme.ofHom g)).hom.unop =
(AffineScheme.forgetToScheme.op β Scheme.Ξ).map pullback.fst.op
β’ P (Scheme.Ξ.map pullback.fst.op)
[PROOFSTEP]
simp only [Quiver.Hom.unop_op, Functor.comp_map, AffineScheme.forgetToScheme_map, Functor.op_map] at this
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
this :
pullback.fst.unop β«
(PreservesPullback.iso (AffineScheme.forgetToScheme.op β Scheme.Ξ).rightOp (AffineScheme.ofHom f)
(AffineScheme.ofHom g)).hom.unop =
Scheme.Ξ.map pullback.fst.op
β’ P (Scheme.Ξ.map pullback.fst.op)
[PROOFSTEP]
rw [β this, hP'.cancel_right_isIso, β pushoutIsoUnopPullback_inl_hom (Quiver.Hom.unop _) (Quiver.Hom.unop _),
hP'.cancel_right_isIso]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Y
instβ : IsAffine S
f : X βΆ S
g : Y βΆ S
H : P (Scheme.Ξ.map g.op)
this :
pullback.fst.unop β«
(PreservesPullback.iso (AffineScheme.forgetToScheme.op β Scheme.Ξ).rightOp (AffineScheme.ofHom f)
(AffineScheme.ofHom g)).hom.unop =
Scheme.Ξ.map pullback.fst.op
β’ P pushout.inl
[PROOFSTEP]
exact hP.pushout_inl _ hP' _ _ H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
β’ MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
[PROOFSTEP]
apply AffineTargetMorphismProperty.respectsIso_mk
[GOAL]
case hβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
β’ β {X Y Z : Scheme} (e : X β
Y) (f : Y βΆ Z) [inst : IsAffine Z],
sourceAffineLocally P f β sourceAffineLocally P (e.hom β« f)
[PROOFSTEP]
introv H U
[GOAL]
case hβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
X Y Z : Scheme
e : X β
Y
f : Y βΆ Z
instβ : IsAffine Z
H : sourceAffineLocally P f
U : β(Scheme.affineOpens X)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« e.hom β« f).op)
[PROOFSTEP]
rw [β hβ.cancel_right_isIso _ (Scheme.Ξ.map (Scheme.restrictMapIso e.inv U.1).hom.op), β Functor.map_comp, β op_comp]
[GOAL]
case hβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
X Y Z : Scheme
e : X β
Y
f : Y βΆ Z
instβ : IsAffine Z
H : sourceAffineLocally P f
U : β(Scheme.affineOpens X)
β’ P
(Scheme.Ξ.map
((Scheme.restrictMapIso e.inv βU).hom β«
Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« e.hom β« f).op)
[PROOFSTEP]
convert H β¨_, U.prop.map_isIso e.invβ© using 3
-- Porting note : have to add this instance manually
[GOAL]
case h.e'_5.h.e'_8.h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
X Y Z : Scheme
e : X β
Y
f : Y βΆ Z
instβ : IsAffine Z
H : sourceAffineLocally P f
U : β(Scheme.affineOpens X)
β’ (Scheme.restrictMapIso e.inv βU).hom β« Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« e.hom β« f =
Scheme.ofRestrict Y
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := (Opens.map e.inv.val.base).obj βU,
property := (_ : IsAffineOpen ((Opens.map e.inv.val.base).obj βU)) })) β«
f
[PROOFSTEP]
haveI i1 : IsOpenImmersion (Scheme.ofRestrict Y ((Opens.map e.inv.val.base).obj U.1).openEmbedding β« e.inv) :=
PresheafedSpace.IsOpenImmersion.comp _ _
[GOAL]
case h.e'_5.h.e'_8.h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
X Y Z : Scheme
e : X β
Y
f : Y βΆ Z
instβ : IsAffine Z
H : sourceAffineLocally P f
U : β(Scheme.affineOpens X)
i1 :
IsOpenImmersion
(Scheme.ofRestrict Y (_ : OpenEmbedding β(Opens.inclusion ((Opens.map e.inv.val.base).obj βU))) β« e.inv)
β’ (Scheme.restrictMapIso e.inv βU).hom β« Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« e.hom β« f =
Scheme.ofRestrict Y
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := (Opens.map e.inv.val.base).obj βU,
property := (_ : IsAffineOpen ((Opens.map e.inv.val.base).obj βU)) })) β«
f
[PROOFSTEP]
rw [IsOpenImmersion.isoOfRangeEq_hom, IsOpenImmersion.lift_fac_assoc, Category.assoc, e.inv_hom_id_assoc]
[GOAL]
case hβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
β’ β {X Y Z : Scheme} (e : Y β
Z) (f : X βΆ Y) [h : IsAffine Y],
sourceAffineLocally P f β sourceAffineLocally P (f β« e.hom)
[PROOFSTEP]
introv H U
[GOAL]
case hβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
X Y Z : Scheme
e : Y β
Z
f : X βΆ Y
h : IsAffine Y
H : sourceAffineLocally P f
U : β(Scheme.affineOpens X)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f β« e.hom).op)
[PROOFSTEP]
rw [β Category.assoc, op_comp, Functor.map_comp, hβ.cancel_left_isIso]
[GOAL]
case hβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
X Y Z : Scheme
e : Y β
Z
f : X βΆ Y
h : IsAffine Y
H : sourceAffineLocally P f
U : β(Scheme.affineOpens X)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
exact H U
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
β’ affineLocally P f β
β (U : β(Scheme.affineOpens Y)) (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU),
P (Scheme.Hom.appLe f e)
[PROOFSTEP]
apply forall_congr'
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
β’ β (a : β(Scheme.affineOpens Y)),
sourceAffineLocally P (f β£_ βa) β
β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βa), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
intro U
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
β’ sourceAffineLocally P (f β£_ βU) β
β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
delta sourceAffineLocally
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
β’ (β
(U_1 :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(Scheme.Ξ.map
(Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1)) β«
f β£_ βU).op)) β
β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
simp_rw [op_comp, Scheme.Ξ.map_comp, Ξ_map_morphismRestrict, Category.assoc, Scheme.Ξ_map_op, hP.cancel_left_isIso]
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
β’ (β
(U_1 :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))) β
β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
constructor
[GOAL]
case h.mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
β’ (β
(U_1 :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))) β
β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
intro H V e
[GOAL]
case h.mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
β’ P (Scheme.Hom.appLe f e)
[PROOFSTEP]
let U' := (Opens.map f.val.base).obj U.1
[GOAL]
case h.mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
β’ P (Scheme.Hom.appLe f e)
[PROOFSTEP]
have e' : U'.openEmbedding.isOpenMap.functor.obj ((Opens.map U'.inclusion).obj V.1) = V.1 :=
by
ext1; refine' Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left_iff_subset.mpr _)
erw [Subtype.range_val]
convert e
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
[PROOFSTEP]
ext1
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
β’ β((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV)) = ββV
[PROOFSTEP]
refine' Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left_iff_subset.mpr _)
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
β’ (βV).1 β Set.range fun x => β(Opens.inclusion U') x
[PROOFSTEP]
erw [Subtype.range_val]
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
β’ (βV).1 β βU'
[PROOFSTEP]
convert e
[GOAL]
case h.mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ P (Scheme.Hom.appLe f e)
[PROOFSTEP]
have := H β¨(Opens.map (X.ofRestrict U'.openEmbedding).1.base).obj V.1, ?_β©
[GOAL]
case h.mp.refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ :
OpenEmbedding
β(Opens.inclusion
β{
val :=
(Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).val.c
(op β€))
β’ P (Scheme.Hom.appLe f e)
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV β
Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
erw [β X.presheaf.map_comp] at this
[GOAL]
case h.mp.refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).counit
(op β€).unop).op))
β’ P (Scheme.Hom.appLe f e)
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV β
Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV β
Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
rw [β hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc, β X.presheaf.map_comp]
[GOAL]
case h.mp.refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).counit
(op β€).unop).op))
β’ P (NatTrans.app f.val.c (op βU) β« X.presheaf.map ((homOfLE e).op β« eqToHom ?m.92694))
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).counit
(op β€).unop).op))
β’ (Opens ββX.toPresheafedSpace)α΅α΅
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).counit
(op β€).unop).op))
β’ op βV = ?m.93449
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).counit
(op β€).unop).op))
β’ op βV = ?m.93449
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property := ?h.mp.refine_1 }))).counit
(op β€).unop).op))
β’ op βV = ?m.93449
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV β
Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV β
Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
convert this using 1
[GOAL]
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV β
Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
apply (@isAffineOpen_iff_of_isOpenImmersion _ _ (@Scheme.ofRestrict _ X U'.inclusion _) ?_ _).mp
[GOAL]
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsAffineOpen
((PresheafedSpace.IsOpenImmersion.openFunctor ?m.94942).obj
((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV))
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
erw [e']
[GOAL]
case h.mp.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsAffineOpen βV
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
apply V.2
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
β’ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property :=
(_ :
IsAffineOpen
((Opens.map
(Scheme.ofRestrict X
(_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV)) }))).counit
(op β€).unop).op))
β’ op βV =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj βV,
property :=
(_ :
IsAffineOpen
((Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV)) }))).op.obj
(op β€))
[PROOFSTEP]
dsimp only [Functor.op, unop_op]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property :=
(_ :
IsAffineOpen
((Opens.map
(Scheme.ofRestrict X
(_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV)) }))).counit
(op β€).unop).op))
β’ op βV =
op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
((Opens.map
(Scheme.ofRestrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).val.base).obj
βV)))).obj
β€))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property :=
(_ :
IsAffineOpen
((Opens.map
(Scheme.ofRestrict X
(_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV)) }))).counit
(op β€).unop).op))
β’ op βV =
op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj
((Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).val.base).obj
βV))
[PROOFSTEP]
congr 1
[GOAL]
case e_x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H :
β
(U_1 :
β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
V : β(Scheme.affineOpens X)
e : βV β€ (Opens.map f.val.base).obj βU
U' : Opens ββX.toPresheafedSpace := (Opens.map f.val.base).obj βU
e' : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj βV) = βV
this :
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV,
property :=
(_ :
IsAffineOpen
((Opens.map
(Scheme.ofRestrict X
(_ : OpenEmbedding β(Opens.inclusion U'))).val.base).obj
βV)) }))).counit
(op β€).unop).op))
β’ βV =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj
((Opens.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).val.base).obj
βV)
[PROOFSTEP]
apply e'.symm
[GOAL]
case h.mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
β’ (β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU), P (Scheme.Hom.appLe f e)) β
β
(U_1 :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))),
P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βU_1))).val.c
(op β€))
[PROOFSTEP]
intro H V
[GOAL]
case h.mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
H : β (V : β(Scheme.affineOpens X)) (e : βV β€ (Opens.map f.val.base).obj βU), P (Scheme.Hom.appLe f e)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
β’ P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βV))).val.c
(op β€))
[PROOFSTEP]
specialize H β¨_, V.2.imageIsOpenImmersion (X.ofRestrict _)β© (Subtype.coe_image_subset _ _)
[GOAL]
case h.mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
NatTrans.app
(Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))
(_ : OpenEmbedding β(Opens.inclusion βV))).val.c
(op β€))
[PROOFSTEP]
erw [β X.presheaf.map_comp]
[GOAL]
case h.mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βV))).counit (op β€).unop).op))
[PROOFSTEP]
rw [β hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc, β X.presheaf.map_comp]
[GOAL]
case h.mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ P
(NatTrans.app f.val.c (op βU) β«
X.presheaf.map
(((eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj β€ =
(Opens.map f.val.base).obj βU)).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βV))).counit (op β€).unop).op) β«
eqToHom ?m.96601))
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ (Opens ββX.toPresheafedSpace)α΅α΅
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βV))).op.obj (op β€)) =
?m.97455
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βV))).op.obj (op β€)) =
?m.97455
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βV))).op.obj (op β€)) =
?m.97455
[PROOFSTEP]
convert H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).op.obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βV))).op.obj (op β€)) =
op
β{
val :=
(Scheme.Hom.opensFunctor
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).obj
βV,
property :=
(_ :
IsAffineOpen
((Scheme.Hom.opensFunctor
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).obj
βV)) }
[PROOFSTEP]
dsimp only [Functor.op, unop_op]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens Y)
V : β(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ββV β β((Opens.map f.val.base).obj βU)))
β’ op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion ((Opens.map f.val.base).obj βU)))).obj
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βV))).obj β€)) =
op
((Scheme.Hom.opensFunctor
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).obj
βV)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (op β€))
H : sourceAffineLocally P f
U :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ : OpenEmbedding β(Opens.inclusion βU)) β«
f β£_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
specialize H β¨_, U.2.imageIsOpenImmersion (X.ofRestrict _)β©
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (op β€))
U :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
H :
P
(Scheme.Ξ.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
β{
val :=
(Scheme.Hom.opensFunctor
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
βU,
property :=
(_ :
IsAffineOpen
((Scheme.Hom.opensFunctor
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
βU)) })) β«
f).op)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ : OpenEmbedding β(Opens.inclusion βU)) β«
f β£_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
letI i1 : Algebra (Y.presheaf.obj <| Opposite.op β€) (Localization.Away r) := Localization.algebra
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (op β€))
U :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
H :
P
(Scheme.Ξ.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
β{
val :=
(Scheme.Hom.opensFunctor
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
βU,
property :=
(_ :
IsAffineOpen
((Scheme.Hom.opensFunctor
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
βU)) })) β«
f).op)
i1 : Algebra (β(Y.presheaf.obj (op β€))) (Localization.Away r) := Localization.algebra
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ : OpenEmbedding β(Opens.inclusion βU)) β«
f β£_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
exact
(hβ.ofRestrict_morphismRestrict_iff f r
((Scheme.Hom.opensFunctor (X.ofRestrict ((Opens.map f.1.base).obj <| Y.basicOpen r).openEmbedding)).obj U.1)
(IsAffineOpen.imageIsOpenImmersion U.2 (X.ofRestrict ((Opens.map f.1.base).obj <| Y.basicOpen r).openEmbedding))
(Opens.ext (Set.preimage_image_eq _ Subtype.coe_injective).symm)).mpr
(hβ.away r H)
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
β’ AffineTargetMorphismProperty.IsLocal (sourceAffineLocally P)
[PROOFSTEP]
constructor
[GOAL]
case RespectsIso
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
β’ MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
[PROOFSTEP]
exact sourceAffineLocally_respectsIso hβ
[GOAL]
case toBasicOpen
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
β’ β {X Y : Scheme} [inst : IsAffine Y] (f : X βΆ Y) (r : β(Y.presheaf.obj (op β€))),
sourceAffineLocally P f β sourceAffineLocally P (f β£_ Scheme.basicOpen Y r)
[PROOFSTEP]
introv H U
[GOAL]
case toBasicOpen
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (op β€))
H : sourceAffineLocally P f
U :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
(_ : OpenEmbedding β(Opens.inclusion βU)) β«
f β£_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
apply scheme_restrict_basicOpen_of_localizationPreserves hβ hβ
[GOAL]
case toBasicOpen.H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
r : β(Y.presheaf.obj (op β€))
H : sourceAffineLocally P f
U :
β(Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
β’ sourceAffineLocally P f
[PROOFSTEP]
assumption
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
β’ β {X Y : Scheme} [inst : IsAffine Y] (f : X βΆ Y) (s : Finset β(Y.presheaf.obj (op β€))),
Ideal.span βs = β€ β
(β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)) β sourceAffineLocally P f
[PROOFSTEP]
introv hs hs' U
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
skip
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
apply hβ _ _ hs
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
β’ β (r : ββs),
P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) βr)
[PROOFSTEP]
intro r
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
β’ P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) βr)
[PROOFSTEP]
have := hs' r β¨(Opens.map (X.ofRestrict _).1.base).obj U.1, ?_β©
[GOAL]
case ofBasicOpenCover.refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
this :
P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr)))))
(_ :
OpenEmbedding
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU,
property := ?ofBasicOpenCover.refine_1 })) β«
f β£_ Scheme.basicOpen Y βr).op)
β’ P (Localization.awayMap (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) βr)
case ofBasicOpenCover.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
β’ (Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU β
Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr)))))
[PROOFSTEP]
rwa [hβ.ofRestrict_morphismRestrict_iff] at this
[GOAL]
case ofBasicOpenCover.refine_2.hU
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
this :
P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr)))))
(_ :
OpenEmbedding
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU,
property := ?ofBasicOpenCover.refine_1 })) β«
f β£_ Scheme.basicOpen Y βr).op)
β’ IsAffineOpen βU
[PROOFSTEP]
exact U.2
[GOAL]
case ofBasicOpenCover.refine_2.e
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
this :
P
(Scheme.Ξ.map
(Scheme.ofRestrict
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr)))))
(_ :
OpenEmbedding
β(Opens.inclusion
β{
val :=
(Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU,
property := ?ofBasicOpenCover.refine_1 })) β«
f β£_ Scheme.basicOpen Y βr).op)
β’ β{
val :=
(Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU,
property := ?ofBasicOpenCover.refine_1 } =
(Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU
[PROOFSTEP]
rfl
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
β’ (Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU β
Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr)))))
[PROOFSTEP]
suffices
β (V) (_ : V = (Opens.map f.val.base).obj (Y.basicOpen r.val)),
IsAffineOpen ((Opens.map (X.ofRestrict V.openEmbedding).1.base).obj U.1)
by exact this _ rfl
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
this :
β (V : Opens ββX.toPresheafedSpace),
V = (Opens.map f.val.base).obj (Scheme.basicOpen Y βr) β
IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion V))).val.base).obj βU)
β’ (Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr))))).val.base).obj
βU β
Scheme.affineOpens
(Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y βr)))))
[PROOFSTEP]
exact this _ rfl
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
β’ β (V : Opens ββX.toPresheafedSpace),
V = (Opens.map f.val.base).obj (Scheme.basicOpen Y βr) β
IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion V))).val.base).obj βU)
[PROOFSTEP]
intro V hV
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
V : Opens ββX.toPresheafedSpace
hV : V = (Opens.map f.val.base).obj (Scheme.basicOpen Y βr)
β’ IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion V))).val.base).obj βU)
[PROOFSTEP]
rw [Scheme.preimage_basicOpen] at hV
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
V : Opens ββX.toPresheafedSpace
hV : V = Scheme.basicOpen X (β(NatTrans.app f.val.c (op β€)) βr)
β’ IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion V))).val.base).obj βU)
[PROOFSTEP]
subst hV
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hβ : RingHom.RespectsIso P
hβ : RingHom.LocalizationPreserves P
hβ : RingHom.OfLocalizationSpan P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
s : Finset β(Y.presheaf.obj (op β€))
hs : Ideal.span βs = β€
hs' : β (r : { x // x β s }), sourceAffineLocally P (f β£_ Scheme.basicOpen Y βr)
U : β(Scheme.affineOpens X)
r : ββs
β’ IsAffineOpen
((Opens.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion (Scheme.basicOpen X (β(NatTrans.app f.val.c (op β€)) βr))))).val.base).obj
βU)
[PROOFSTEP]
exact U.2.mapRestrictBasicOpen (Scheme.Ξ.map f.op r.1)
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs : Ideal.span s = β€
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
apply_fun Ideal.map (X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op) at hs
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.map (X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
(Ideal.span s) =
Ideal.map (X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) β€
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
rw [Ideal.map_span, Ideal.map_top] at hs
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
apply hβ _ _ hs
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
β’ β
(r :
β(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) ''
s)),
P
(RingHom.comp
(algebraMap (β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
(Localization.Away βr))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op))
[PROOFSTEP]
rintro β¨s, r, hr, hsβ©
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
sβ : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βsβ),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hsβ :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) ''
sβ) =
β€
s : β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
r : β(X.presheaf.obj (op βU))
hr : r β sβ
hs : β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r = s
β’ P
(RingHom.comp
(algebraMap (β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
(Localization.Away
β{ val := s,
property :=
(_ :
β a,
a β sβ β§
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
a =
s) }))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op))
[PROOFSTEP]
have :=
(@Localization.algEquiv _ _ _ _ _ _
(@AlgebraicGeometry.Ξ_restrict_isLocalization _ U.2 s)).toRingEquiv.toCommRingCatIso
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
sβ : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βsβ),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hsβ :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) ''
sβ) =
β€
s : β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
r : β(X.presheaf.obj (op βU))
hr : r β sβ
hs : β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r = s
this :
CommRingCat.of (Localization (Submonoid.powers s)) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU))) s))))))
β’ P
(RingHom.comp
(algebraMap (β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
(Localization.Away
β{ val := s,
property :=
(_ :
β a,
a β sβ β§
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
a =
s) }))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op))
[PROOFSTEP]
refine
(hβ.cancel_right_isIso _
(@Localization.algEquiv _ _ _ _ _ _
(@AlgebraicGeometry.Ξ_restrict_isLocalization _ U.2 s)).toRingEquiv.toCommRingCatIso.hom).mp
?_
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
sβ : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βsβ),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hsβ :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) ''
sβ) =
β€
s : β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
r : β(X.presheaf.obj (op βU))
hr : r β sβ
hs : β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r = s
this :
CommRingCat.of (Localization (Submonoid.powers s)) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU))) s))))))
β’ P
(RingHom.comp
(algebraMap (β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
(Localization.Away
β{ val := s,
property :=
(_ :
β a,
a β sβ β§
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
a =
s) }))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) β«
(RingEquiv.toCommRingCatIso
(AlgEquiv.toRingEquiv
(Localization.algEquiv (Submonoid.powers s)
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
s))))))))).hom)
[PROOFSTEP]
subst hs
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
(RingHom.comp
(algebraMap (β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
(Localization.Away
β{
val :=
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r,
property :=
(_ :
β a,
a β s β§
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
a =
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r) }))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) β«
(RingEquiv.toCommRingCatIso
(AlgEquiv.toRingEquiv
(Localization.algEquiv
(Submonoid.powers
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))))).hom)
[PROOFSTEP]
rw [CommRingCat.comp_eq_ring_hom_comp, β RingHom.comp_assoc]
-- Porting note: here is where it gets bad; previously `erw [IsLocalization.map_comp]`
-- ask Lean to synthesize instances and it runs away
-- we also have to pass in one `Localization` instance now (and not before)
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
(RingHom.comp
(RingHom.comp
(RingEquiv.toCommRingCatIso
(AlgEquiv.toRingEquiv
(Localization.algEquiv
(Submonoid.powers
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))))).hom
(algebraMap (β(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
(Localization.Away
β{
val :=
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r,
property :=
(_ :
β a,
a β s β§
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
a =
β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r) })))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op))
[PROOFSTEP]
erw [@IsLocalization.map_comp _ _ _ _ _ (_) (Scheme.Ξ.obj (Opposite.op (X.restrict U.1.openEmbedding))) _ (_) _
(Submonoid.powers (X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op r))
((Scheme.Ξ.obj
(Opposite.op
((X.restrict U.1.openEmbedding).restrict
((X.restrict U.1.openEmbedding).basicOpen
(X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op r)).openEmbedding))))
_ (le_of_eq rfl) (_) (@AlgebraicGeometry.Ξ_restrict_isLocalization _ U.2 _)]
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
(RingHom.comp
(RingHom.comp
(algebraMap β(Scheme.Ξ.obj (op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))))
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))))))
β(RingEquiv.refl β(Scheme.Ξ.obj (op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op))
[PROOFSTEP]
erw [RingHom.comp_id]
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
(RingHom.comp
(algebraMap β(Scheme.Ξ.obj (op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))))
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))))))
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op))
[PROOFSTEP]
rw [RingHom.algebraMap_toAlgebra, op_comp, Functor.map_comp, β CommRingCat.comp_eq_ring_hom_comp, Scheme.Ξ_map_op,
Scheme.Ξ_map_op, Scheme.Ξ_map_op, Category.assoc]
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
(NatTrans.app f.val.c (op β€) β«
NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU))).val.c (op β€) β«
NatTrans.app
(Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).val.c
(op β€))
[PROOFSTEP]
erw [β X.presheaf.map_comp]
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
(NatTrans.app f.val.c (op β€) β«
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit (op β€).unop).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).counit
(op β€).unop).op))
[PROOFSTEP]
rw [β hβ.cancel_right_isIso _ (X.presheaf.map (eqToHom _))]
[GOAL]
case mk.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ P
((NatTrans.app f.val.c (op β€) β«
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit (op β€).unop).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).counit
(op β€).unop).op)) β«
X.presheaf.map (eqToHom ?m.148221))
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (Opens ββX.toPresheafedSpace)α΅α΅
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
?m.148220
[PROOFSTEP]
convert hs' β¨r, hrβ© using 1
[GOAL]
case h.e'_5.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
e_4β :
CommRingCat.instCommRingΞ±
(X.presheaf.obj
((IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€))) =
CommRingCat.instCommRingΞ±
(Scheme.Ξ.obj
(op
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr }))))))
β’ (NatTrans.app f.val.c (op β€) β«
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit (op β€).unop).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).counit
(op β€).unop).op)) β«
X.presheaf.map (eqToHom ?m.148221) =
Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr }))) β«
f).op
[PROOFSTEP]
erw [Category.assoc]
[GOAL]
case h.e'_5.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
e_4β :
CommRingCat.instCommRingΞ±
(X.presheaf.obj
((IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€))) =
CommRingCat.instCommRingΞ±
(Scheme.Ξ.obj
(op
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr }))))))
β’ NatTrans.app f.val.c (op β€) β«
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit (op β€).unop).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).counit
(op β€).unop).op) β«
X.presheaf.map (eqToHom ?m.148221) =
Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr }))) β«
f).op
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
[PROOFSTEP]
rw [β X.presheaf.map_comp, op_comp, Scheme.Ξ.map_comp, Scheme.Ξ_map_op, Scheme.Ξ_map_op]
[GOAL]
case h.e'_5.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
e_4β :
CommRingCat.instCommRingΞ±
(X.presheaf.obj
((IsOpenMap.functor
(_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€))) =
CommRingCat.instCommRingΞ±
(Scheme.Ξ.obj
(op
(Scheme.restrict X
(_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr }))))))
β’ NatTrans.app f.val.c (op β€) β«
X.presheaf.map
(((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit (op β€).unop).op β«
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.map
(NatTrans.app
(IsOpenMap.adjunction
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).counit
(op β€).unop).op) β«
eqToHom ?m.148221) =
NatTrans.app f.val.c (op β€) β«
NatTrans.app
(Scheme.ofRestrict X
(_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).val.c
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
[PROOFSTEP]
congr!
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
[PROOFSTEP]
all_goals
Β· dsimp [Functor.op]
conv_lhs => rw [Opens.openEmbedding_obj_top]
conv_rhs => rw [Opens.openEmbedding_obj_top]
erw [Scheme.image_basicOpen (X.ofRestrict U.1.openEmbedding)]
erw [PresheafedSpace.IsOpenImmersion.ofRestrict_invApp_apply]
rw [Scheme.basicOpen_res_eq]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).op.obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).op.obj
(op β€)) =
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X β{ val := r, property := hr })))).op.obj
(op β€)
[PROOFSTEP]
dsimp [Functor.op]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).obj
β€)) =
op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)
[PROOFSTEP]
conv_lhs => rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
| op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).obj
β€))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
| op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).obj
β€))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
| op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj
((IsOpenMap.functor
(_ :
IsOpenMap
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))).obj
β€))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) =
op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)
[PROOFSTEP]
conv_rhs => rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
| op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
| op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
| op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ op
((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) =
op (Scheme.basicOpen X r)
[PROOFSTEP]
erw [Scheme.image_basicOpen (X.ofRestrict U.1.openEmbedding)]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ op
(Scheme.basicOpen X
(β(Scheme.Hom.invApp (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU))) β€)
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) =
op (Scheme.basicOpen X r)
[PROOFSTEP]
erw [PresheafedSpace.IsOpenImmersion.ofRestrict_invApp_apply]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
hβ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X βΆ Y
U : β(Scheme.affineOpens X)
s : Set β(X.presheaf.obj (op βU))
hs' :
β (r : βs),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X βr))) β« f).op)
hs :
Ideal.span
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) '' s) =
β€
r : β(X.presheaf.obj (op βU))
hr : r β s
this :
CommRingCat.of
(Localization
(Submonoid.powers
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))) β
CommRingCat.of
β(Scheme.Ξ.obj
(op
(Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(_ :
OpenEmbedding
β(Opens.inclusion
(Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU)))
(β(X.presheaf.map
(eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r)))))))
β’ op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)) =
op (Scheme.basicOpen X r)
[PROOFSTEP]
rw [Scheme.basicOpen_res_eq]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ P (Scheme.Ξ.map (f β« g).op)
[PROOFSTEP]
rw [β hβ.cancel_right_isIso _ (Scheme.Ξ.map (IsOpenImmersion.isoOfRangeEq (Y.ofRestrict _) f _).hom.op), β
Functor.map_comp, β op_comp]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ P (Scheme.Ξ.map ((IsOpenImmersion.isoOfRangeEq (Scheme.ofRestrict Y ?m.164260) f ?m.164267).hom β« f β« g).op)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ TopCat
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ ?m.164258 βΆ TopCat.of ββY.toPresheafedSpace
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ OpenEmbedding β?m.164259
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ Set.range β(Scheme.ofRestrict Y ?m.164260).val.base = Set.range βf.val.base
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ TopCat
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ ?m.164258 βΆ TopCat.of ββY.toPresheafedSpace
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ OpenEmbedding β?m.164259
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ Set.range β(Scheme.ofRestrict Y ?m.164260).val.base = Set.range βf.val.base
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ TopCat
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ ?m.164258 βΆ TopCat.of ββY.toPresheafedSpace
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ OpenEmbedding β?m.164259
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ Set.range β(Scheme.ofRestrict Y ?m.164260).val.base = Set.range βf.val.base
[PROOFSTEP]
convert hβ β¨_, rangeIsAffineOpenOfOpenImmersion fβ© using 3
[GOAL]
case h.e'_5.h.h.e'_8.h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ (IsOpenImmersion.isoOfRangeEq
(Scheme.ofRestrict Y
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := Scheme.Hom.opensRange f, property := (_ : IsAffineOpen (Scheme.Hom.opensRange f)) })))
f ?m.164267).hom β«
f β« g =
Scheme.ofRestrict Y
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := Scheme.Hom.opensRange f, property := (_ : IsAffineOpen (Scheme.Hom.opensRange f)) })) β«
g
[PROOFSTEP]
rw [IsOpenImmersion.isoOfRangeEq_hom, IsOpenImmersion.lift_fac_assoc]
[GOAL]
case h.e'_5.h.h.e'_8.h.e'_5.e
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : RingHom.PropertyIsLocal P
hβ : RingHom.RespectsIso P
X Y Z : Scheme
instβΒ² : IsAffine X
instβΒΉ : IsAffine Z
f : X βΆ Y
instβ : IsOpenImmersion f
g : Y βΆ Z
hβ : sourceAffineLocally P g
β’ Set.range
β(Scheme.ofRestrict Y
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := Scheme.Hom.opensRange f,
property := (_ : IsAffineOpen (Scheme.Hom.opensRange f)) }))).val.base =
Set.range βf.val.base
[PROOFSTEP]
exact Subtype.range_coe
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ sourceAffineLocally P f
[PROOFSTEP]
let S i :=
(β¨β¨Set.range (π°.map i).1.base, (π°.IsOpen i).base_open.open_rangeβ©, rangeIsAffineOpenOfOpenImmersion (π°.map i)β© :
X.affineOpens)
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
β’ sourceAffineLocally P f
[PROOFSTEP]
intro U
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
apply of_affine_open_cover (P := fun V => P (Scheme.Ξ.map (X.ofRestrict (Opens.openEmbedding V.val) β« f).op)) U
[GOAL]
case hPβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (U : β(Scheme.affineOpens X)) (f_1 : β(X.presheaf.obj (Opposite.op βU))),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) β
P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X f_1))) β« f).op)
case hPβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (U : β(Scheme.affineOpens X)) (s : Finset β(X.presheaf.obj (Opposite.op βU))),
Ideal.span βs = β€ β
(β (f_1 : { x // x β s }),
P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X βf_1))) β« f).op)) β
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
case hS
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (i : β?S), βββi = Set.univ
case hS'
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (U : β?S), P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ββU)) β« f).op)
case S
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ Set β(Scheme.affineOpens X)
[PROOFSTEP]
pick_goal 5
[GOAL]
case S
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ Set β(Scheme.affineOpens X)
[PROOFSTEP]
exact Set.range S
[GOAL]
case hPβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (U : β(Scheme.affineOpens X)) (f_1 : β(X.presheaf.obj (Opposite.op βU))),
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op) β
P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X f_1))) β« f).op)
[PROOFSTEP]
intro U r H
[GOAL]
case hPβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X r))) β« f).op)
[PROOFSTEP]
convert
hP.StableUnderComposition (S := Scheme.Ξ.obj (Opposite.op (X.restrict <| Opens.openEmbedding U.val))) (T :=
Scheme.Ξ.obj (Opposite.op (X.restrict <| Opens.openEmbedding (X.basicOpen r)))) ?_ ?_ H ?_ using
1
[GOAL]
case h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X r))) β« f).op =
comp ?hPβ.convert_1 (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
case hPβ.convert_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU))))) β+*
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X r))))))
case hPβ.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ P ?hPβ.convert_1
[PROOFSTEP]
swap
[GOAL]
case hPβ.convert_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU))))) β+*
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X r))))))
[PROOFSTEP]
refine' X.presheaf.map (@homOfLE _ _ ((IsOpenMap.functor _).obj _) ((IsOpenMap.functor _).obj _) _).op
[GOAL]
case hPβ.convert_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop
[PROOFSTEP]
rw [unop_op, unop_op, Opens.openEmbedding_obj_top, Opens.openEmbedding_obj_top]
[GOAL]
case hPβ.convert_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ Scheme.basicOpen X r β€ βU
[PROOFSTEP]
exact X.basicOpen_le _
[GOAL]
case h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X r))) β« f).op =
comp
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop)).op)
(Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
rw [op_comp, op_comp, Functor.map_comp, Functor.map_comp]
[GOAL]
case h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ Scheme.Ξ.map f.op β«
Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X r)))).op =
comp
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop)).op)
(Scheme.Ξ.map f.op β« Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU))).op)
[PROOFSTEP]
refine' (Eq.trans _ (Category.assoc (obj := CommRingCat) _ _ _).symm : _)
[GOAL]
case h.e'_5
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ Scheme.Ξ.map f.op β«
Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X r)))).op =
Scheme.Ξ.map f.op β«
Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU))).op β«
X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop)).op
[PROOFSTEP]
congr 1
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X r)))).op =
Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU))).op β«
X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop)).op
[PROOFSTEP]
dsimp
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ X.presheaf.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).counit β€).op =
X.presheaf.map (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit β€).op β«
X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)).op
[PROOFSTEP]
refine' Eq.trans _ (X.presheaf.map_comp _ _)
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ X.presheaf.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).counit β€).op =
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit β€).op β«
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)).op)
[PROOFSTEP]
change X.presheaf.map _ = _
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ X.presheaf.map
(NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).counit β€).op =
X.presheaf.map
((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap β(Opens.inclusion βU))).counit β€).op β«
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)).op)
[PROOFSTEP]
congr!
-- Porting note: need to pass Algebra through explicitly
[GOAL]
case hPβ.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ P
(X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop)).op)
[PROOFSTEP]
convert
@HoldsForLocalizationAway _ hP _ (Scheme.Ξ.obj (Opposite.op (X.restrict (X.basicOpen r).openEmbedding))) _ _ ?_
(X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op r) ?_
[GOAL]
case h.e'_5.h.h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
e_1β :
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU))))) =
(fun x =>
(forget CommRingCat).obj
(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
r
heβ :
CommRingCat.instCommRingΞ± (Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion βU))))) =
CommRingCat.instCommRing'
(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
β’ X.presheaf.map
(homOfLE
(_ :
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op β€).unop β€
(IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj (Opposite.op β€).unop)).op =
algebraMap
((fun x =>
(forget CommRingCat).obj
(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))))
r)
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X r))))))
[PROOFSTEP]
exact
RingHom.algebraMap_toAlgebra (R := Scheme.Ξ.obj <| Opposite.op <| X.restrict (U.1.openEmbedding)) (S :=
Scheme.Ξ.obj (Opposite.op <| X.restrict (X.affineBasicOpen r).1.openEmbedding)) _ |>.symm
[GOAL]
case hPβ.convert_2.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ IsLocalization.Away
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
β(Scheme.Ξ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding β(Opens.inclusion (Scheme.basicOpen X r))))))
[PROOFSTEP]
dsimp [Scheme.Ξ]
[GOAL]
case hPβ.convert_2.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
β’ IsLocalization.Away
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)))
[PROOFSTEP]
have := U.2
[GOAL]
case hPβ.convert_2.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : βU β Scheme.affineOpens X
β’ IsLocalization.Away
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)))
[PROOFSTEP]
rw [β U.1.openEmbedding_obj_top] at this
[GOAL]
case hPβ.convert_2.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
β’ IsLocalization.Away
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€)))
[PROOFSTEP]
convert (config := { typeEqs := true, transparency := .default }) isLocalization_basicOpen this _ using 5
[GOAL]
case h.e'_4.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
case h.e'_5.e'_2.e'_1.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
case h.e'_6.e'_2.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
case h.e'_6.e'_5.h.e'_7.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4βΒΉ :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1β :
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))) =
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
e_2β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
heβ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
case h.e'_6.e'_5.h.e'_8.e'_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4βΒΉ :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1β :
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))) =
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
e_2β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
heβ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_7β :
Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€) =
Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
all_goals rw [Opens.openEmbedding_obj_top]; exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_4.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_4.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
β’ Scheme.basicOpen X r =
Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_5.e'_2.e'_1.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_5.e'_2.e'_1.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
β’ Scheme.basicOpen X r =
Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_6.e'_2.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_6.e'_2.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
β’ Scheme.basicOpen X r =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_6.e'_5.h.e'_7.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4βΒΉ :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1β :
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))) =
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
e_2β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
heβ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_6.e'_5.h.e'_7.h.e'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4βΒΉ :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1β :
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))) =
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
e_2β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
heβ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
β’ Scheme.basicOpen X r =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_6.e'_5.h.e'_8.e'_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4βΒΉ :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1β :
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))) =
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
e_2β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
heβ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_7β :
Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€) =
Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r))
β’ (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€ =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_6.e'_5.h.e'_8.e'_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
Hβ : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
r : β(X.presheaf.obj (Opposite.op βU))
H : P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
this : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ β Scheme.affineOpens X
e_4βΒΉ :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(Scheme.basicOpen X
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
e_5β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1β :
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€))) =
β(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€)))
e_2β :
β(X.presheaf.obj
(Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€))) =
β(X.presheaf.obj
(Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op)
r))))
heβ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4β : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_7β :
Opposite.op ((IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion (Scheme.basicOpen X r)))).obj β€) =
Opposite.op
(RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r))
β’ Scheme.basicOpen X r =
RingedSpace.basicOpen X.toSheafedSpace
(β(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap β(Opens.inclusion βU))).obj β€ = βU)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case hPβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (U : β(Scheme.affineOpens X)) (s : Finset β(X.presheaf.obj (Opposite.op βU))),
Ideal.span βs = β€ β
(β (f_1 : { x // x β s }),
P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X βf_1))) β« f).op)) β
P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
introv hs hs'
[GOAL]
case hPβ
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
Uβ U : β(Scheme.affineOpens X)
s : Finset β(X.presheaf.obj (Opposite.op βU))
hs : Ideal.span βs = β€
hs' :
β (f_1 : { x // x β s }),
P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(Scheme.affineBasicOpen X βf_1))) β« f).op)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion βU)) β« f).op)
[PROOFSTEP]
exact sourceAffineLocally_of_source_open_cover_aux hP.respectsIso hP.2 _ _ _ hs hs'
[GOAL]
case hS
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (i : β(Set.range S)), βββi = Set.univ
[PROOFSTEP]
rw [Set.eq_univ_iff_forall]
[GOAL]
case hS
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (x : ββX.toPresheafedSpace), x β β (i : β(Set.range S)), βββi
[PROOFSTEP]
intro x
[GOAL]
case hS
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
x : ββX.toPresheafedSpace
β’ x β β (i : β(Set.range S)), βββi
[PROOFSTEP]
rw [Set.mem_iUnion]
[GOAL]
case hS
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
x : ββX.toPresheafedSpace
β’ β i, x β βββi
[PROOFSTEP]
exact β¨β¨_, π°.f x, rflβ©, π°.Covers xβ©
[GOAL]
case hS'
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
β’ β (U : β(Set.range S)), P (Scheme.Ξ.map (Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ββU)) β« f).op)
[PROOFSTEP]
rintro β¨_, i, rflβ©
[GOAL]
case hS'.mk.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
i : π°.J
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ββ{ val := S i, property := (_ : β y, S y = S i) })) β«
f).op)
[PROOFSTEP]
specialize H i
[GOAL]
case hS'.mk.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
i : π°.J
H : P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ββ{ val := S i, property := (_ : β y, S y = S i) })) β«
f).op)
[PROOFSTEP]
rw [β
hP.respectsIso.cancel_right_isIso _
(Scheme.Ξ.map
(IsOpenImmersion.isoOfRangeEq (π°.map i) (X.ofRestrict (S i).1.openEmbedding) Subtype.range_coe.symm).inv.op)] at
H
[GOAL]
case hS'.mk.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
S : π°.J β { x // x β Scheme.affineOpens X } :=
fun i =>
{
val :=
{ carrier := Set.range β(Scheme.OpenCover.map π° i).val.base,
is_open' := (_ : IsOpen (Set.range β(Scheme.OpenCover.map π° i).val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map π° i))) }
U : β(Scheme.affineOpens X)
i : π°.J
H :
P
(Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op β«
Scheme.Ξ.map
(IsOpenImmersion.isoOfRangeEq (Scheme.OpenCover.map π° i)
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion β(S i))))
(_ : Set.range β(Scheme.OpenCover.map π° i).val.base = Set.range Subtype.val)).inv.op)
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ββ{ val := S i, property := (_ : β y, S y = S i) })) β«
f).op)
[PROOFSTEP]
rwa [β Scheme.Ξ.map_comp, β op_comp, IsOpenImmersion.isoOfRangeEq_inv, IsOpenImmersion.lift_fac_assoc] at H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
β’ List.TFAE
[sourceAffineLocally P f, β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)]
[PROOFSTEP]
tfae_have 1 β 4
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
β’ sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
[PROOFSTEP]
intro H U g _ hg
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
H : sourceAffineLocally P f
U : Scheme
g : U βΆ X
instβ : IsAffine U
hg : IsOpenImmersion g
β’ P (Scheme.Ξ.map (g β« f).op)
[PROOFSTEP]
skip
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
H : sourceAffineLocally P f
U : Scheme
g : U βΆ X
instβ : IsAffine U
hg : IsOpenImmersion g
β’ P (Scheme.Ξ.map (g β« f).op)
[PROOFSTEP]
specialize H β¨β¨_, hg.base_open.open_rangeβ©, rangeIsAffineOpenOfOpenImmersion gβ©
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
U : Scheme
g : U βΆ X
instβ : IsAffine U
hg : IsOpenImmersion g
H :
P
(Scheme.Ξ.map
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := { carrier := Set.range βg.val.base, is_open' := (_ : IsOpen (Set.range βg.val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange g)) })) β«
f).op)
β’ P (Scheme.Ξ.map (g β« f).op)
[PROOFSTEP]
rw [β
hP.respectsIso.cancel_right_isIso _
(Scheme.Ξ.map
(IsOpenImmersion.isoOfRangeEq g (X.ofRestrict (Opens.openEmbedding β¨_, hg.base_open.open_rangeβ©))
Subtype.range_coe.symm).hom.op),
β Scheme.Ξ.map_comp, β op_comp, IsOpenImmersion.isoOfRangeEq_hom] at H
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
U : Scheme
g : U βΆ X
instβ : IsAffine U
hg : IsOpenImmersion g
H :
P
(Scheme.Ξ.map
(IsOpenImmersion.lift
(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
{ carrier := Set.range βg.val.base, is_open' := (_ : IsOpen (Set.range βg.val.base)) })))
g
(_ :
Set.range βg.val.base β€
Set.range
β(Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
{ carrier := Set.range βg.val.base,
is_open' := (_ : IsOpen (Set.range βg.val.base)) }))).val.base) β«
Scheme.ofRestrict X
(_ :
OpenEmbedding
β(Opens.inclusion
β{ val := { carrier := Set.range βg.val.base, is_open' := (_ : IsOpen (Set.range βg.val.base)) },
property := (_ : IsAffineOpen (Scheme.Hom.opensRange g)) })) β«
f).op)
β’ P (Scheme.Ξ.map (g β« f).op)
[PROOFSTEP]
erw [IsOpenImmersion.lift_fac_assoc] at H
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
U : Scheme
g : U βΆ X
instβ : IsAffine U
hg : IsOpenImmersion g
H : P (Scheme.Ξ.map (g β« f).op)
β’ P (Scheme.Ξ.map (g β« f).op)
[PROOFSTEP]
exact H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
β’ List.TFAE
[sourceAffineLocally P f, β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)]
[PROOFSTEP]
tfae_have 4 β 3
[GOAL]
case tfae_4_to_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
β’ (β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
intro H π° _ i
[GOAL]
case tfae_4_to_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
H : β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
i : π°.J
β’ P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
skip
[GOAL]
case tfae_4_to_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβΒΉ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
H : β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
i : π°.J
β’ P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
apply H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ List.TFAE
[sourceAffineLocally P f, β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)]
[PROOFSTEP]
tfae_have 3 β 2
[GOAL]
case tfae_3_to_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ (β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β
β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
intro H
[GOAL]
case tfae_3_to_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
H :
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
refine' β¨X.affineCover, inferInstance, H _β©
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β
β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ List.TFAE
[sourceAffineLocally P f, β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)]
[PROOFSTEP]
tfae_have 2 β 1
[GOAL]
case tfae_2_to_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β
β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ (β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β sourceAffineLocally P f
[PROOFSTEP]
rintro β¨π°, _, hπ°β©
[GOAL]
case tfae_2_to_1.intro.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β
β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
π° : Scheme.OpenCover X
wβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
hπ° : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ sourceAffineLocally P f
[PROOFSTEP]
exact sourceAffineLocally_of_source_openCover hP f π° hπ°
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)) β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β
β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
tfae_2_to_1 : (β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β sourceAffineLocally P f
β’ List.TFAE
[sourceAffineLocally P f, β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op),
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)]
[PROOFSTEP]
tfae_finish
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
β’ List.TFAE
[sourceAffineLocally P f, β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)]
[PROOFSTEP]
tfae_have 1 β 4
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
β’ sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
[PROOFSTEP]
intro H U g hg V
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : sourceAffineLocally P f
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g β« f).op)
[PROOFSTEP]
skip
-- Porting note: this has metavariable if I put it directly into rw
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : sourceAffineLocally P f
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g β« f).op)
[PROOFSTEP]
have := (hP.affine_openCover_TFAE f).out 0 3
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : sourceAffineLocally P f
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
this :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g β« f).op)
[PROOFSTEP]
rw [this] at H
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
this :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
β’ P (Scheme.Ξ.map (Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g β« f).op)
[PROOFSTEP]
haveI : IsAffine _ := V.2
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
thisβ :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
this : IsAffine (Scheme.restrict U (_ : OpenEmbedding β(Opens.inclusion βV)))
β’ P (Scheme.Ξ.map (Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g β« f).op)
[PROOFSTEP]
rw [β Category.assoc]
-- Porting note: Lean could find this previously
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
thisβ :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
this : IsAffine (Scheme.restrict U (_ : OpenEmbedding β(Opens.inclusion βV)))
β’ P (Scheme.Ξ.map ((Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g) β« f).op)
[PROOFSTEP]
have : IsOpenImmersion <| (Scheme.ofRestrict U (Opens.openEmbedding V.val)) β« g :=
LocallyRingedSpace.IsOpenImmersion.comp _ _
[GOAL]
case tfae_1_to_4
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
H : β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
U : Scheme
g : U βΆ X
hg : IsOpenImmersion g
V : β(Scheme.affineOpens U)
thisβΒΉ :
sourceAffineLocally P f β
β {U : Scheme} (g : U βΆ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Ξ.map (g β« f).op)
thisβ : IsAffine (Scheme.restrict U (_ : OpenEmbedding β(Opens.inclusion βV)))
this : IsOpenImmersion (Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g)
β’ P (Scheme.Ξ.map ((Scheme.ofRestrict U (_ : OpenEmbedding β(Opens.inclusion βV)) β« g) β« f).op)
[PROOFSTEP]
apply H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
β’ List.TFAE
[sourceAffineLocally P f, β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)]
[PROOFSTEP]
tfae_have 4 β 3
[GOAL]
case tfae_4_to_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
β’ (β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
[PROOFSTEP]
intro H π° _ i
[GOAL]
case tfae_4_to_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
H : β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
π° : Scheme.OpenCover X
iβ : π°.J
i : β(Scheme.affineOpens (Scheme.OpenCover.obj π° iβ))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict (Scheme.OpenCover.obj π° iβ) (_ : OpenEmbedding β(Opens.inclusion βi)) β«
Scheme.OpenCover.map π° iβ β« f).op)
[PROOFSTEP]
skip
[GOAL]
case tfae_4_to_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
H : β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
π° : Scheme.OpenCover X
iβ : π°.J
i : β(Scheme.affineOpens (Scheme.OpenCover.obj π° iβ))
β’ P
(Scheme.Ξ.map
(Scheme.ofRestrict (Scheme.OpenCover.obj π° iβ) (_ : OpenEmbedding β(Opens.inclusion βi)) β«
Scheme.OpenCover.map π° iβ β« f).op)
[PROOFSTEP]
apply H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
β’ List.TFAE
[sourceAffineLocally P f, β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)]
[PROOFSTEP]
tfae_have 3 β 2
[GOAL]
case tfae_3_to_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
β’ (β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
[PROOFSTEP]
intro H
[GOAL]
case tfae_3_to_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
H : β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
β’ β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
[PROOFSTEP]
refine' β¨X.affineCover, H _β©
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
β’ List.TFAE
[sourceAffineLocally P f, β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)]
[PROOFSTEP]
tfae_have 2 β 1
[GOAL]
case tfae_2_to_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
β’ (β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β sourceAffineLocally P f
[PROOFSTEP]
rintro
β¨π°, hπ°β©
-- Porting note: this has metavariable if I put it directly into rw
[GOAL]
case tfae_2_to_1.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
β’ sourceAffineLocally P f
[PROOFSTEP]
have := (hP.affine_openCover_TFAE f).out 0 1
[GOAL]
case tfae_2_to_1.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ sourceAffineLocally P f
[PROOFSTEP]
rw [this]
[GOAL]
case tfae_2_to_1.intro
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
refine' β¨π°.bind fun _ => Scheme.affineCover _, _, _β©
[GOAL]
case tfae_2_to_1.intro.refine'_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ β (i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J),
IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i)
[PROOFSTEP]
intro i
[GOAL]
case tfae_2_to_1.intro.refine'_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
β’ IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i)
[PROOFSTEP]
dsimp
[GOAL]
case tfae_2_to_1.intro.refine'_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
β’ IsAffine (Scheme.OpenCover.obj (Scheme.affineCover (Scheme.OpenCover.obj π° i.fst)) i.snd)
[PROOFSTEP]
infer_instance
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ β (i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J),
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i β«
f).op)
[PROOFSTEP]
intro i
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
hπ° : β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i β« f).op)
[PROOFSTEP]
specialize
hπ°
i.1
-- Porting note: this has metavariable if I put it directly into rw
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
this : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° : sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i β« f).op)
[PROOFSTEP]
have := (hP.affine_openCover_TFAE (π°.map i.fst β« f)).out 0 3
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
thisβ : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° : sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f)
this :
sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f) β
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i β« f).op)
[PROOFSTEP]
rw [this] at hπ°
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
thisβ : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° :
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
this :
sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f) β
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i β« f).op)
[PROOFSTEP]
erw [Category.assoc]
-- Porting note: this was discharged after the apply previously
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
thisβ : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° :
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
this :
sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f) β
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map ((fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i.fst) i.snd β«
Scheme.OpenCover.map π° i.fst β« f).op)
[PROOFSTEP]
have :
IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind π° fun x β¦ Scheme.affineCover (Scheme.OpenCover.obj π° x)) i) :=
by dsimp; infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
thisβ : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° :
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
this :
sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f) β
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
β’ IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
thisβ : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° :
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
this :
sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f) β
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
β’ IsAffine (Scheme.OpenCover.obj (Scheme.affineCover (Scheme.OpenCover.obj π° i.fst)) i.snd)
[PROOFSTEP]
infer_instance
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
π° : Scheme.OpenCover X
thisβΒΉ : sourceAffineLocally P f β β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
i : (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)).J
hπ° :
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
thisβ :
sourceAffineLocally P (Scheme.OpenCover.map π° i.fst β« f) β
β {U : Scheme} (g : U βΆ Scheme.OpenCover.obj π° i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
P (Scheme.Ξ.map (g β« Scheme.OpenCover.map π° i.fst β« f).op)
this :
IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind π° fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map ((fun x => Scheme.affineCover (Scheme.OpenCover.obj π° x)) i.fst) i.snd β«
Scheme.OpenCover.map π° i.fst β« f).op)
[PROOFSTEP]
apply @hπ° _ (show _ from _)
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
instβ : IsAffine Y
f : X βΆ Y
tfae_1_to_4 :
sourceAffineLocally P f β β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)
tfae_4_to_3 :
(β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)) β
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_3_to_2 :
(β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β
β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)
tfae_2_to_1 : (β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f)) β sourceAffineLocally P f
β’ List.TFAE
[sourceAffineLocally P f, β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β (π° : Scheme.OpenCover X) (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f),
β {U : Scheme} (g : U βΆ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g β« f)]
[PROOFSTEP]
tfae_finish
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y Z : Scheme
instβΒΉ : IsAffine Z
f : X βΆ Y
g : Y βΆ Z
instβ : IsOpenImmersion f
H : sourceAffineLocally P g
β’ sourceAffineLocally P (f β« g)
[PROOFSTEP]
have := (hP.openCover_TFAE g).out 0 3
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y Z : Scheme
instβΒΉ : IsAffine Z
f : X βΆ Y
g : Y βΆ Z
instβ : IsOpenImmersion f
H : sourceAffineLocally P g
this :
sourceAffineLocally P g β β {U : Scheme} (g_1 : U βΆ Y) [inst : IsOpenImmersion g_1], sourceAffineLocally P (g_1 β« g)
β’ sourceAffineLocally P (f β« g)
[PROOFSTEP]
apply this.mp H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
β’ sourceAffineLocally P f β β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
refine β¨fun H => ?_, fun H => ?_β©
[GOAL]
case refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : sourceAffineLocally P f
β’ β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
have h := (hP.affine_openCover_TFAE f).out 0 2
[GOAL]
case refine_1
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : sourceAffineLocally P f
h :
sourceAffineLocally P f β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
apply h.mp
[GOAL]
case refine_1.a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : sourceAffineLocally P f
h :
sourceAffineLocally P f β
β (π° : Scheme.OpenCover X) [inst : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)] (i : π°.J),
P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ sourceAffineLocally P f
[PROOFSTEP]
exact H
[GOAL]
case refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
β’ sourceAffineLocally P f
[PROOFSTEP]
have h := (hP.affine_openCover_TFAE f).out 1 0
[GOAL]
case refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
h : (β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β sourceAffineLocally P f
β’ sourceAffineLocally P f
[PROOFSTEP]
apply h.mp
[GOAL]
case refine_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
instβΒΉ : IsAffine Y
π° : Scheme.OpenCover X
instβ : β (i : π°.J), IsAffine (Scheme.OpenCover.obj π° i)
H : β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
h : (β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)) β sourceAffineLocally P f
β’ β π° x, β (i : π°.J), P (Scheme.Ξ.map (Scheme.OpenCover.map π° i β« f).op)
[PROOFSTEP]
use π°
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
β’ affineLocally P f β β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
[PROOFSTEP]
constructor
[GOAL]
case mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
β’ affineLocally P f β β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
[PROOFSTEP]
intro H i U
[GOAL]
case mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : affineLocally P f
i : π°.J
U : β(Scheme.affineOpens Y)
β’ sourceAffineLocally P ((Scheme.OpenCover.map π° i β« f) β£_ βU)
[PROOFSTEP]
rw [morphismRestrict_comp]
[GOAL]
case mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : affineLocally P f
i : π°.J
U : β(Scheme.affineOpens Y)
β’ sourceAffineLocally P ((Scheme.OpenCover.map π° i β£_ (Opens.map f.val.base).obj βU) β« f β£_ βU)
[PROOFSTEP]
delta morphismRestrict
[GOAL]
case mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : affineLocally P f
i : π°.J
U : β(Scheme.affineOpens Y)
β’ sourceAffineLocally P
(((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd) β«
(pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
[PROOFSTEP]
have : IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) := U.property
[GOAL]
case mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : affineLocally P f
i : π°.J
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ sourceAffineLocally P
(((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd) β«
(pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
[PROOFSTEP]
have :
IsOpenImmersion
((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd) :=
LocallyRingedSpace.IsOpenImmersion.comp _ _
[GOAL]
case mp
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : affineLocally P f
i : π°.J
U : β(Scheme.affineOpens Y)
thisβ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
this :
IsOpenImmersion
((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd)
β’ sourceAffineLocally P
(((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd) β«
(pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
[PROOFSTEP]
apply hP.sourceAffineLocally_comp_of_isOpenImmersion
[GOAL]
case mp.H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : affineLocally P f
i : π°.J
U : β(Scheme.affineOpens Y)
thisβ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
this :
IsOpenImmersion
((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd)
β’ sourceAffineLocally P ((pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
[PROOFSTEP]
apply H
[GOAL]
case mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
β’ (β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)) β affineLocally P f
[PROOFSTEP]
intro H U
[GOAL]
case mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
U : β(Scheme.affineOpens Y)
β’ sourceAffineLocally P (f β£_ βU)
[PROOFSTEP]
haveI : IsAffine _ := U.2
[GOAL]
case mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ sourceAffineLocally P (f β£_ βU)
[PROOFSTEP]
apply ((hP.openCover_TFAE (f β£_ U.1)).out 1 0).mp
[GOAL]
case mpr
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ β π°, β (i : π°.J), sourceAffineLocally P (Scheme.OpenCover.map π° i β« f β£_ βU)
[PROOFSTEP]
use π°.pullbackCover (X.ofRestrict _)
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ β
(i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J),
sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
intro i
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
H : β (i : π°.J), affineLocally P (Scheme.OpenCover.map π° i β« f)
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J
β’ sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
specialize H i U
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J
H : sourceAffineLocally P ((Scheme.OpenCover.map π° i β« f) β£_ βU)
β’ sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
rw [morphismRestrict_comp] at H
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J
H : sourceAffineLocally P ((Scheme.OpenCover.map π° i β£_ (Opens.map f.val.base).obj βU) β« f β£_ βU)
β’ sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
delta morphismRestrict at H
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
U : β(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J
H :
sourceAffineLocally P
(((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd) β«
(pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
β’ sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
have := sourceAffineLocally_respectsIso hP.respectsIso
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
U : β(Scheme.affineOpens Y)
thisβ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J
H :
sourceAffineLocally P
(((pullbackRestrictIsoRestrict (Scheme.OpenCover.map π° i) ((Opens.map f.val.base).obj βU)).inv β« pullback.snd) β«
(pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
this : MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
β’ sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
rw [Category.assoc, affine_cancel_left_isIso this, β affine_cancel_left_isIso this (pullbackSymmetry _ _).hom,
pullbackSymmetry_hom_comp_snd_assoc] at H
[GOAL]
case h
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
π° : Scheme.OpenCover X
U : β(Scheme.affineOpens Y)
thisβ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i :
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU))))).J
Hβ : sourceAffineLocally P (pullback.snd β« (pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
H : sourceAffineLocally P (pullback.fst β« (pullbackRestrictIsoRestrict f βU).inv β« pullback.snd)
this : MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
β’ sourceAffineLocally P
(Scheme.OpenCover.map
(Scheme.OpenCover.pullbackCover π°
(Scheme.ofRestrict X (_ : OpenEmbedding β(Opens.inclusion ((Opens.map f.val.base).obj βU)))))
i β«
f β£_ βU)
[PROOFSTEP]
exact H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
β’ affineLocally P f
[PROOFSTEP]
intro U
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
β’ sourceAffineLocally P (f β£_ βU)
[PROOFSTEP]
haveI H : IsAffine _ := U.2
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ sourceAffineLocally P (f β£_ βU)
[PROOFSTEP]
rw [β Category.comp_id (f β£_ U)]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ sourceAffineLocally P ((f β£_ βU) β« π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
[PROOFSTEP]
apply hP.sourceAffineLocally_comp_of_isOpenImmersion
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ sourceAffineLocally P (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
[PROOFSTEP]
rw [@source_affine_openCover_iff _ hP _ _ _ _ (Scheme.openCoverOfIsIso (π _)) (_)]
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ β (i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J),
P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))) i β«
π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))).op)
[PROOFSTEP]
intro i
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i β«
π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))).op)
[PROOFSTEP]
erw [Category.id_comp, op_id, Scheme.Ξ.map_id]
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
β’ P (π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))))
[PROOFSTEP]
let esto := Scheme.Ξ.obj (Opposite.op (Y.restrict <| Opens.openEmbedding U.val))
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
β’ P (π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))))
[PROOFSTEP]
let eso :=
Scheme.Ξ.obj
(Opposite.op ((Scheme.openCoverOfIsIso (π (Y.restrict <| Opens.openEmbedding U.val))).obj i))
-- Porting note: Lean this needed this spelled out before
-- convert hP.HoldsAwayLocalizationAway _ (1 : Scheme.Ξ.obj _) _
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
eso : CommRingCat :=
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i))
β’ P (π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))))
[PROOFSTEP]
have : π (Scheme.Ξ.obj (Opposite.op (Y.restrict <| Opens.openEmbedding U.val))) = @algebraMap esto eso _ _ (_) :=
(RingHom.algebraMap_toAlgebra _).symm
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
eso : CommRingCat :=
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i))
this :
π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))) = algebraMap βesto βeso
β’ P (π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))))
[PROOFSTEP]
rw [this]
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
eso : CommRingCat :=
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i))
this :
π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))) = algebraMap βesto βeso
β’ P (algebraMap βesto βeso)
[PROOFSTEP]
have := hP.HoldsForLocalizationAway
[GOAL]
case H
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
eso : CommRingCat :=
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i))
thisβ :
π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))) = algebraMap βesto βeso
this : RingHom.HoldsForLocalizationAway P
β’ P (algebraMap βesto βeso)
[PROOFSTEP]
convert @this esto eso _ _ ?_ ?_ ?_
[GOAL]
case H.convert_2
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
eso : CommRingCat :=
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i))
thisβ :
π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))) = algebraMap βesto βeso
this : RingHom.HoldsForLocalizationAway P
β’ βesto
[PROOFSTEP]
exact
1
-- Porting note: again we have to bypass TC synthesis to keep Lean from running away
[GOAL]
case H.convert_3
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
esto : CommRingCat := Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))
eso : CommRingCat :=
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i))
thisβ :
π (Scheme.Ξ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))) = algebraMap βesto βeso
this : RingHom.HoldsForLocalizationAway P
β’ IsLocalization.Away 1 βeso
[PROOFSTEP]
refine' @IsLocalization.away_of_isUnit_of_bijective _ _ _ _ (_) _ isUnit_one Function.bijective_id
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
β’ β (i : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J),
IsAffine
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
i)
[PROOFSTEP]
intro
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hPβ hP : PropertyIsLocal P
X Y : Scheme
f : X βΆ Y
hf : IsOpenImmersion f
U : β(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))
iβ : (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU))))).J
β’ IsAffine
(Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (π (Scheme.restrict Y (_ : OpenEmbedding β(Opens.inclusion βU)))))
iβ)
[PROOFSTEP]
exact H
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
β’ affineLocally P f
[PROOFSTEP]
let π° : β i, ((Z.affineCover.pullbackCover (f β« g)).obj i).OpenCover :=
by
intro i
refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (Z.affineCover.map i) f).hom
apply Scheme.Pullback.openCoverOfRight
exact (pullback g (Z.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
β’ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i)
[PROOFSTEP]
intro i
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J
β’ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i)
[PROOFSTEP]
refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J
β’ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i)
[PROOFSTEP]
apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (Z.affineCover.map i) f).hom
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J
β’ Scheme.OpenCover (pullback f pullback.fst)
[PROOFSTEP]
apply Scheme.Pullback.openCoverOfRight
[GOAL]
case π°
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J
β’ Scheme.OpenCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))
[PROOFSTEP]
exact (pullback g (Z.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
β’ affineLocally P f
[PROOFSTEP]
have hπ° : β i j, IsAffine ((π° i).obj j) := by dsimp; infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
β’ β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
β’ β (i : (Scheme.affineCover Z).J)
(j :
(i_1 : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J) Γ
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
i_1 β«
pullback.fst))).J),
IsAffine
(Scheme.OpenCover.obj
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j.fst β«
pullback.fst)))
j.snd)
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
β’ affineLocally P f
[PROOFSTEP]
let π°' := (Z.affineCover.pullbackCover g).bind fun i => Scheme.affineCover _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
β’ affineLocally P f
[PROOFSTEP]
have hπ°' : β i, IsAffine (π°'.obj i) := by dsimp; infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
β’ β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
β’ β
(i :
(i : (Scheme.affineCover Z).J) Γ
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J),
IsAffine
(Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i.fst))) i.snd)
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
β’ affineLocally P f
[PROOFSTEP]
rw [hP.affine_openCover_iff f π°' fun i => Scheme.affineCover _]
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
h : affineLocally P (f β« g)
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
β’ β (i : (Scheme.OpenCover.pullbackCover π°' f).J)
(j : (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) i)).J),
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) i)) j β«
pullback.snd).op)
[PROOFSTEP]
rw [hP.affine_openCover_iff (f β« g) Z.affineCover π°] at h
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
h :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) j β« pullback.snd).op)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
β’ β (i : (Scheme.OpenCover.pullbackCover π°' f).J)
(j : (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) i)).J),
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) i)) j β«
pullback.snd).op)
[PROOFSTEP]
rintro β¨i, jβ© k
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
h :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) j β« pullback.snd).op)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g).J
j :
((fun i => Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)) i).J
k : (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) { fst := i, snd := j })).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) { fst := i, snd := j })) k β«
pullback.snd).op)
[PROOFSTEP]
dsimp at i j k
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
h :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) j β« pullback.snd).op)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) { fst := i, snd := j })) k β«
pullback.snd).op)
[PROOFSTEP]
specialize h i β¨j, kβ©
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
h : P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) { fst := j, snd := k } β« pullback.snd).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover π°' f) { fst := i, snd := j })) k β«
pullback.snd).op)
[PROOFSTEP]
dsimp only [Scheme.OpenCover.bind_map, Scheme.OpenCover.pushforwardIso_obj, Scheme.Pullback.openCoverOfRight_obj,
Scheme.OpenCover.pushforwardIso_map, Scheme.Pullback.openCoverOfRight_map, Scheme.OpenCover.bind_obj,
Scheme.OpenCover.pullbackCover_obj, Scheme.OpenCover.pullbackCover_map] at h β’
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
h :
P
(Scheme.Ξ.map
((Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k β«
pullback.map f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)
f pullback.fst (π X)
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j)
(π Y) (_ : f β« π Y = π X β« f)
(_ :
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst) β«
π Y =
Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst) β«
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom) β«
pullback.snd).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
rw [Category.assoc, Category.assoc, pullbackRightPullbackFstIso_hom_snd, pullback.lift_snd_assoc, Category.assoc, β
Category.assoc, op_comp, Functor.map_comp] at h
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
h :
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op β«
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k β«
pullback.snd).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
let f' :=
Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
h :
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op β«
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k β«
pullback.snd).op)
f' : Scheme.Ξ.obj (Opposite.op (Scheme.OpenCover.obj (Scheme.affineCover Z) i)) βΆ
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) :=
Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
let g' :=
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
h :
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op β«
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k β«
pullback.snd).op)
f' : Scheme.Ξ.obj (Opposite.op (Scheme.OpenCover.obj (Scheme.affineCover Z) i)) βΆ
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) :=
Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op
g' : Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) βΆ
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k)) :=
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
convert H f' g' ?_
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
H :
β {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R β+* S) (g : S β+* T),
P (comp g f) β P g
X Y Z : Scheme
f : X βΆ Y
g : Y βΆ Z
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
i_1)
hπ° :
β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
π°' : Scheme.OpenCover Y :=
Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
hπ°' : β (i : π°'.J), IsAffine (Scheme.OpenCover.obj π°' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst))).J
h :
P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op β«
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k β«
pullback.snd).op)
f' : Scheme.Ξ.obj (Opposite.op (Scheme.OpenCover.obj (Scheme.affineCover Z) i)) βΆ
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) :=
Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.snd).op
g' : Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) βΆ
Scheme.Ξ.obj
(Opposite.op
(Scheme.OpenCover.obj
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j β«
pullback.fst)))
k)) :=
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op
β’ P (comp g' f')
[PROOFSTEP]
exact h
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
β’ MorphismProperty.StableUnderComposition (affineLocally P)
[PROOFSTEP]
intro X Y S f g hf hg
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
β’ affineLocally P (f β« g)
[PROOFSTEP]
let π° : β i, ((S.affineCover.pullbackCover (f β« g)).obj i).OpenCover :=
by
intro i
refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom
apply Scheme.Pullback.openCoverOfRight
exact (pullback g (S.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
β’ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i)
[PROOFSTEP]
intro i
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
β’ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i)
[PROOFSTEP]
refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
β’ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i)
[PROOFSTEP]
apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
β’ Scheme.OpenCover (pullback f pullback.fst)
[PROOFSTEP]
apply Scheme.Pullback.openCoverOfRight
[GOAL]
case π°
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
β’ Scheme.OpenCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))
[PROOFSTEP]
exact (pullback g (S.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ affineLocally P (f β« g)
[PROOFSTEP]
apply (@affine_openCover_iff _ hP _ _ (f β« g) S.affineCover _ ?_ ?_).mpr
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) (j : (?m.591569 i).J),
P (Scheme.Ξ.map (Scheme.OpenCover.map (?m.591569 i) j β« pullback.snd).op)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i)
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) (j : (?m.591569 i).J),
IsAffine (Scheme.OpenCover.obj (?m.591569 i) j)
[PROOFSTEP]
rotate_left
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i)
[PROOFSTEP]
exact π°
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) (j : (π° i).J),
IsAffine (Scheme.OpenCover.obj (π° i) j)
[PROOFSTEP]
intro i j
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
j : (π° i).J
β’ IsAffine (Scheme.OpenCover.obj (π° i) j)
[PROOFSTEP]
dsimp at *
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
j : (π° i).J
β’ IsAffine
(Scheme.OpenCover.obj
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j.fst β«
pullback.fst)))
j.snd)
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
β’ β (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) (j : (π° i).J),
P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) j β« pullback.snd).op)
[PROOFSTEP]
rintro i β¨j, kβ©
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J
j :
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom).J
k :
((fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1))
j).J
β’ P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) { fst := j, snd := k } β« pullback.snd).op)
[PROOFSTEP]
dsimp at i j k
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ P (Scheme.Ξ.map (Scheme.OpenCover.map (π° i) { fst := j, snd := k } β« pullback.snd).op)
[PROOFSTEP]
dsimp only [Scheme.OpenCover.bind_map, Scheme.OpenCover.pushforwardIso_obj, Scheme.Pullback.openCoverOfRight_obj,
Scheme.OpenCover.pushforwardIso_map, Scheme.Pullback.openCoverOfRight_map, Scheme.OpenCover.bind_obj]
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ P
(Scheme.Ξ.map
((Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst)))
k β«
pullback.map f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)
f pullback.fst (π X)
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j)
(π Y) (_ : f β« π Y = π X β« f)
(_ :
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst) β«
π Y =
Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst) β«
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom) β«
pullback.snd).op)
[PROOFSTEP]
rw [Category.assoc, Category.assoc, pullbackRightPullbackFstIso_hom_snd, pullback.lift_snd_assoc, Category.assoc, β
Category.assoc, op_comp, Functor.map_comp]
[GOAL]
case mk
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.snd).op β«
Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
apply hP.StableUnderComposition
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.snd).op)
[PROOFSTEP]
apply hP.affine_openCover_iff _ _ _ |>.mp
[GOAL]
case mk.x.a
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ affineLocally P g
[PROOFSTEP]
exact hg
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : affineLocally P f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
delta affineLocally at hf
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : targetAffineLocally (sourceAffineLocally P) f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
have := (hP.isLocal_sourceAffineLocally.affine_openCover_TFAE f).out 0 3
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : targetAffineLocally (sourceAffineLocally P) f
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
this :
targetAffineLocally (sourceAffineLocally P) f β
β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
rw [this] at hf
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
this :
targetAffineLocally (sourceAffineLocally P) f β
β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
have : IsOpenImmersion <| ((pullback g (S.affineCover.map i)).affineCover.map j β« pullback.fst) :=
LocallyRingedSpace.IsOpenImmersion.comp _ _
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hf : β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
thisβ :
targetAffineLocally (sourceAffineLocally P) f β
β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this :
IsOpenImmersion
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
specialize
hf
((pullback g (S.affineCover.map i)).affineCover.map j β« pullback.fst)
-- Porting note: again strange behavior of TFAE
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
thisβ :
targetAffineLocally (sourceAffineLocally P) f β
β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this :
IsOpenImmersion
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst)
hf : sourceAffineLocally P pullback.snd
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
have :=
(hP.affine_openCover_TFAE
(pullback.snd : pullback f ((pullback g (S.affineCover.map i)).affineCover.map j β« pullback.fst) βΆ _)).out
0 3
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
thisβΒΉ :
targetAffineLocally (sourceAffineLocally P) f β
β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
thisβ :
IsOpenImmersion
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst)
hf : sourceAffineLocally P pullback.snd
this :
sourceAffineLocally P pullback.snd β
β {U : Scheme}
(g_1 :
U βΆ
pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))
[inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Ξ.map (g_1 β« pullback.snd).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
rw [this] at hf
[GOAL]
case mk.x
P : {R S : Type u} β [inst : CommRing R] β [inst_1 : CommRing S] β (R β+* S) β Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X βΆ Y
g : Y βΆ S
hg : affineLocally P g
π° : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)).J) β
Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f β« g)) i) :=
fun i =>
Scheme.OpenCover.bind
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
fun i_1 =>
Scheme.affineCover
(Scheme.OpenCover.obj
(Scheme.OpenCover.pushforwardIso
(Scheme.Pullback.openCoverOfRight
(Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
(pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))).J
thisβΒΉ :
targetAffineLocally (sourceAffineLocally P) f β
β {U : Scheme} (g : U βΆ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
thisβ :
IsOpenImmersion
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst)
hf :
β {U : Scheme}
(g_1 :
U βΆ
pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))
[inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Ξ.map (g_1 β« pullback.snd).op)
this :
sourceAffineLocally P pullback.snd β
β {U : Scheme}
(g_1 :
U βΆ
pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j β«
pullback.fst))
[inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Ξ.map (g_1 β« pullback.snd).op)
β’ P
(Scheme.Ξ.map
(Scheme.OpenCover.map
(Scheme.affineCover
(pullback f
(Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
j β«
pullback.fst)))
k β«
pullback.snd).op)
[PROOFSTEP]
apply hf
|
From Coq Require Import NArith Arith Lia List.
Local Open Scope list_scope.
Definition range (offset count: N)
: list N
:= let fix range' (countdown: nat)
:= match countdown with
| O => nil
| S k => cons (offset + count - 1 - N.of_nat k)%N
(range' k)
end
in range' (N.to_nat count).
Local Example range_example:
range 5 3 = (5 :: 6 :: 7 :: nil)%N.
Proof.
trivial.
Qed.
Definition range_nat (offset count: nat)
: list N
:= let fix range' (countdown: nat)
:= match countdown with
| O => nil
| S k => cons (N.of_nat (offset + count - 1 - k))
(range' k)
end
in range' count.
Lemma range_nat_ok (offset count: nat):
range_nat offset count = range (N.of_nat offset) (N.of_nat count).
Proof.
unfold range, range_nat.
rewrite Nat2N.id.
revert offset. induction count. { trivial. }
intro offset. cbn.
assert (IH := IHcount (S offset)). clear IHcount.
f_equal. { f_equal. lia. }
assert (EqLHS:
forall t,
(fix range' (countdown : nat) : list N :=
match countdown with
| 0 => nil
| S k => (N.of_nat (offset + S count - 1 - k)) :: range' k
end) t
=
(fix range' (countdown : nat) : list N :=
match countdown with
| 0 => nil
| S k => (N.of_nat (S offset + count - 1 - k)) :: range' k
end) t).
{
clear IH. intro t.
revert offset. induction t. { easy. }
intro offset.
f_equal. 2:apply IHt.
f_equal. f_equal. lia.
}
rewrite EqLHS. clear EqLHS.
assert (EqRHS:
forall t,
(fix range' (countdown : nat) : list N :=
match countdown with
| 0 => nil
| S k =>
(N.of_nat offset + N.pos (Pos.of_succ_nat count) - 1 - N.of_nat k)%N :: range' k
end) t
=
(fix range' (countdown : nat) : list N :=
match countdown with
| 0 => nil
| S k => (N.of_nat (S offset) + N.of_nat count - 1 - N.of_nat k)%N :: range' k
end) t).
{
clear IH. intro t.
revert offset. induction t. { easy. }
intro offset.
f_equal. 2:apply IHt.
f_equal. f_equal. lia.
}
rewrite EqRHS. clear EqRHS.
apply IH.
Qed.
Lemma range_via_nat (offset count: N):
range offset count = range_nat (N.to_nat offset) (N.to_nat count).
Proof.
rewrite range_nat_ok.
now repeat rewrite N2Nat.id.
Qed.
Lemma range_cons (offset count: N):
range offset (N.succ count) = offset :: range (N.succ offset) count.
Proof.
rewrite range_via_nat.
unfold range_nat.
revert offset. induction count; intros.
{
cbn. replace (Pos.to_nat 1) with 1 by easy.
f_equal. lia.
}
cbn. rewrite Pnat.Pos2Nat.inj_succ.
f_equal. { lia. }
match goal with
|- ?l _ = ?r _ =>
enough (forall x, l x = r x) by easy
end.
intro x. induction x. { trivial. }
f_equal. { lia. }
apply IHx.
Qed.
|
lemma cmod_complex_polar: "cmod (r * (cos a + \<i> * sin a)) = \<bar>r\<bar>" |
/**
* Copyright (C) 2015 Dato, Inc.
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*/
/**
* Copyright (c) 2009 Carnegie Mellon University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*
* For more about this software visit:
*
* http://www.graphlab.ml.cmu.edu
*
*/
#ifndef GRAPHLAB_SYNCHRONIZED_UNORDERED_MAP
#define GRAPHLAB_SYNCHRONIZED_UNORDERED_MAP
#include <vector>
#include <boost/unordered_map.hpp>
#include <parallel/pthread_tools.hpp>
namespace graphlab {
/// \ingroup util_internal
template <typename Data>
class synchronized_unordered_map {
public:
typedef boost::unordered_map<size_t, Data> container;
typedef typename container::iterator iterator;
typedef typename container::const_iterator const_iterator;
typedef std::pair<bool, Data*> datapointer;
typedef std::pair<bool, const Data*> const_datapointer;
typedef Data value_type;
typedef size_t key_type;
private:
std::vector<container> data;
std::vector<rwlock> lock;
size_t nblocks;
public:
synchronized_unordered_map(size_t numblocks):data(numblocks),
lock(numblocks),
nblocks(numblocks) {
for (size_t i = 0;i < numblocks; ++i) {
data[i].max_load_factor(1.0);
}
}
std::pair<bool, Data*> find(size_t key) {
size_t b = key % nblocks;
lock[b].readlock();
iterator iter = data[b].find(key);
std::pair<bool, Data*> ret = std::make_pair(iter != data[b].end(), &(iter->second));
lock[b].rdunlock();
return ret;
}
/**
return std::pair<found, iterator>
if not found, iterator is invalid
*/
std::pair<bool, const Data*> find(size_t key) const {
size_t b = key % nblocks;
lock[b].readlock();
const_iterator iter = data[b].find(key);
std::pair<bool, const Data*> ret = std::make_pair(iter != data[b].end(), &(iter->second));
lock[b].rdunlock();
return ret;
}
// care must be taken that you do not access an erased iterator
void erase(size_t key) {
size_t b = key % nblocks;
lock[b].writelock();
data[b].erase(key);
lock[b].wrunlock();
}
template<typename Predicate>
void erase_if(size_t key, Predicate pred) {
size_t b = key % nblocks;
lock[b].writelock();
iterator iter = data[b].find(key);
if (iter != data[b].end() && pred(iter->second)) data[b].erase(key);
lock[b].wrunlock();
}
value_type& insert(size_t key, const value_type &val) {
size_t b = key % nblocks;
lock[b].writelock();
data[b][key] = val;
value_type& ret = data[b][key];
lock[b].wrunlock();
return ret;
}
/**
returns std::pair<success, iterator>
on success, iterator will point to the entry
on failure, iterator will point to an existing entry
*/
std::pair<bool, Data*> insert_with_failure_detect(size_t key, const value_type &val) {
std::pair<bool, Data*> ret ;
size_t b = key % nblocks;
lock[b].writelock();
//search for it
iterator iter = data[b].find(key);
// if it not in the table, write and return
if (iter == data[b].end()) {
data[b][key] = val;
ret = std::make_pair(true, &(data[b].find(key)->second));
}
else {
ret = std::make_pair(false, &(iter->second));
}
lock[b].wrunlock();
return ret;
}
void clear() {
for (size_t i = 0;i < data.size(); ++i) {
data[i].clear();
}
}
};
}
#endif
|
import tactic
import data.real.basic
import data.real.irrational
-- Q1) what's the biggest element of {x β β | x < 1}?
theorem soln1 : β a β {x : β | x < 1}, β b β {x : β | x < 1}, a < b :=
begin
intro a,
rintro (ha : a < 1),
use (a + 1) / 2,
split,
{ simp,
linarith },
linarith,
end
open real
-- Q2) Prove that for every positive intger n β 3, βn - β3 is irrational
theorem soln2 : β n : β, 0 < n β§ n β 3 β irrational (sqrt (n : β) - sqrt 3) :=
begin
rintros n β¨hn0, hn3β© hq,
rw set.mem_range at hq,
cases hq with q hq,
have hq1 := add_eq_of_eq_sub hq,
apply_fun (Ξ» x, x * x) at hq1,
have h3 : (0 : β) β€ 3 := by norm_num,
simp [mul_add, add_mul, h3] at hq1,
have hq2 : (2 : β) * q * sqrt 3 = n - q * q - 3,
rw β hq1, ring,
let r : β := n - q * q - 3,
have hq3 : (2 : β) * q * sqrt 3 = r,
convert hq2,
norm_cast,
clear hq1,
clear hq2,
have s3 : irrational (sqrt ((3 : β) : β)),
apply nat.prime.irrational_sqrt,
norm_num,
simp at s3,
have temp : (2 : β) * q * sqrt 3 = sqrt 3 * ((2 : β) * q : β),
rw mul_comm ((2 : β) * _),
norm_cast,
rw temp at hq3,
apply irrational.mul_rat s3,
swap,
use r,
exact hq3.symm,
clear hq3 r s3 temp,
intro h,
rw mul_eq_zero at h,
cases h, linarith,
rw h at hq,
simp at hq,
symmetry' at hq,
rw sub_eq_zero at hq,
apply hn3,
apply_fun (Ξ» x, x * x) at hq,
simp [h3] at hq,
norm_cast at hq,
end
|
theory DDL imports Main (* Christoph BenzmΓΌller & Xavier Parent & Ali Farjami, 2018 *)
begin (* DDL: Dyadic Deontic Logic by Carmo and Jones *)
typedecl i (*type for possible worlds*) type_synonym \<sigma> = "(i\<Rightarrow>bool)"
consts av::"i\<Rightarrow>\<sigma>" pv::"i\<Rightarrow>\<sigma>" ob::"\<sigma>\<Rightarrow>(\<sigma>\<Rightarrow>bool)" (*accessibility relations*) cw::i (*current world*)
axiomatization where
ax_3a: "\<exists>x. av(w)(x)" and ax_4a: "\<forall>x. av(w)(x) \<longrightarrow> pv(w)(x)" and ax_4b: "pv(w)(w)" and
ax_5a: "\<not>ob(X)(\<lambda>x. False)" and
ax_5b: "(\<forall>w. ((Y(w) \<and> X(w)) \<longleftrightarrow> (Z(w) \<and> X(w)))) \<longrightarrow> (ob(X)(Y) \<longleftrightarrow> ob(X)(Z))" and
ax_5c: "((\<forall>Z. \<beta>(Z) \<longrightarrow> ob(X)(Z)) \<and> (\<exists>Z. \<beta>(Z))) \<longrightarrow>
(((\<exists>y. ((\<lambda>w. \<forall>Z. (\<beta> Z) \<longrightarrow> (Z w))(y) \<and> X(y))) \<longrightarrow> ob(X)(\<lambda>w. \<forall>Z. (\<beta> Z) \<longrightarrow> (Z w))))" and
ax_5d: "((\<forall>w. Y(w) \<longrightarrow> X(w)) \<and> ob(X)(Y) \<and> (\<forall>w. X(w) \<longrightarrow> Z(w)))
\<longrightarrow> ob(Z)(\<lambda>w. (Z(w) \<and> \<not>X(w)) \<or> Y(w))" and
ax_5e: "((\<forall>w. Y(w) \<longrightarrow> X(w)) \<and> ob(X)(Z) \<and> (\<exists>w. Y(w) \<and> Z(w))) \<longrightarrow> ob(Y)(Z)"
abbreviation ddlneg ("\<^bold>\<not>_"[52]53) where "\<^bold>\<not>A \<equiv> \<lambda>w. \<not>A(w)"
abbreviation ddland (infixr"\<^bold>\<and>"51) where "A\<^bold>\<and>B \<equiv> \<lambda>w. A(w)\<and>B(w)"
abbreviation ddlor (infixr"\<^bold>\<or>"50) where "A\<^bold>\<or>B \<equiv> \<lambda>w. A(w)\<or>B(w)"
abbreviation ddlimp (infixr"\<^bold>\<rightarrow>"49) where "A\<^bold>\<rightarrow>B \<equiv> \<lambda>w. A(w)\<longrightarrow>B(w)"
abbreviation ddlequiv (infixr"\<^bold>\<leftrightarrow>"48) where "A\<^bold>\<leftrightarrow>B \<equiv> \<lambda>w. A(w)\<longleftrightarrow>B(w)"
abbreviation ddlbox ("\<^bold>\<box>") where "\<^bold>\<box>A \<equiv> \<lambda>w.\<forall>v. A(v)" (*A = (\<lambda>w. True)*)
abbreviation ddlboxa ("\<^bold>\<box>\<^sub>a") where "\<^bold>\<box>\<^sub>aA \<equiv> \<lambda>w. (\<forall>x. av(w)(x) \<longrightarrow> A(x))" (*in all actual worlds*)
abbreviation ddlboxp ("\<^bold>\<box>\<^sub>p") where "\<^bold>\<box>\<^sub>pA \<equiv> \<lambda>w. (\<forall>x. pv(w)(x) \<longrightarrow> A(x))" (*in all potential worlds*)
abbreviation ddldia ("\<^bold>\<diamond>") where "\<^bold>\<diamond>A \<equiv> \<^bold>\<not>\<^bold>\<box>(\<^bold>\<not>A)"
abbreviation ddldiaa ("\<^bold>\<diamond>\<^sub>a") where "\<^bold>\<diamond>\<^sub>aA \<equiv> \<^bold>\<not>\<^bold>\<box>\<^sub>a(\<^bold>\<not>A)"
abbreviation ddldiap ("\<^bold>\<diamond>\<^sub>p") where "\<^bold>\<diamond>\<^sub>pA \<equiv> \<^bold>\<not>\<^bold>\<box>\<^sub>p(\<^bold>\<not>A)"
abbreviation ddlo ("\<^bold>O\<^bold>\<langle>_\<^bold>|_\<^bold>\<rangle>"[52]53) where "\<^bold>O\<^bold>\<langle>B\<^bold>|A\<^bold>\<rangle> \<equiv> \<lambda>w. ob(A)(B)" (*it ought to be \<psi>, given \<phi> *)
abbreviation ddloa ("\<^bold>O\<^sub>a") where "\<^bold>O\<^sub>aA \<equiv> \<lambda>w. ob(av(w))(A) \<and> (\<exists>x. av(w)(x) \<and> \<not>A(x))" (*actual obligation*)
abbreviation ddlop ("\<^bold>O\<^sub>p") where "\<^bold>O\<^sub>pA \<equiv> \<lambda>w. ob(pv(w))(A) \<and> (\<exists>x. pv(w)(x) \<and> \<not>A(x))" (*primary obligation*)
abbreviation ddltop ("\<^bold>\<top>") where "\<^bold>\<top> \<equiv> \<lambda>w. True"
abbreviation ddlbot ("\<^bold>\<bottom>") where "\<^bold>\<bottom> \<equiv> \<lambda>w. False"
abbreviation ddlvalid::"\<sigma> \<Rightarrow> bool" ("\<lfloor>_\<rfloor>"[7]105) where "\<lfloor>A\<rfloor> \<equiv> \<forall>w. A w" (*Global validity*)
abbreviation ddlvalidcw::"\<sigma> \<Rightarrow> bool" ("\<lfloor>_\<rfloor>\<^sub>c\<^sub>w"[7]105) where "\<lfloor>A\<rfloor>\<^sub>c\<^sub>w \<equiv> A cw" (*Local validity (in cw)*)
(* A is obliagtory *)
abbreviation obligatoryDDL::"\<sigma>\<Rightarrow>\<sigma>" ("\<^bold>O\<^bold>\<langle>_\<^bold>\<rangle>") where "\<^bold>O\<^bold>\<langle>A\<^bold>\<rangle> \<equiv> \<^bold>O\<^bold>\<langle>A\<^bold>|\<^bold>\<top>\<^bold>\<rangle>"
(* Consistency *)
lemma True nitpick [satisfy] oops
(* Unimportant *)
sledgehammer_params [max_facts=20,timeout=20] (* Sets parameters for theorem provers *)
nitpick_params [user_axioms,expect=genuine,show_all,format=2] (* ... and model finder. *)
end
|
||| CSS Rules for the Inc. Buttons Example
module Examples.CSS.Reset
import Data.Vect
import Examples.CSS.Colors
import public Examples.CSS.Core
import Rhone.JS
import Text.CSS
--------------------------------------------------------------------------------
-- IDs
--------------------------------------------------------------------------------
||| Where the accumulated count is printed to
public export
out : ElemRef Div
out = Id Div "reset_out"
||| ID of the increasing button
public export
btnInc : ElemRef Button
btnInc = Id Button "reset_inc"
||| ID of the decreasing button
public export
btnDec : ElemRef Button
btnDec = Id Button "reset_dec"
||| ID of the reset button
public export
btnReset : ElemRef Button
btnReset = Id Button "reset_reset"
--------------------------------------------------------------------------------
-- CSS
--------------------------------------------------------------------------------
export
resetLbl : String
resetLbl = "reset_resetlbl"
export
incLbl : String
incLbl = "reset_inclbl"
export
decLbl : String
decLbl = "reset_declbl"
export
countLbl : String
countLbl = "reset_countlbl"
export
resetContent : String
resetContent = "reset_content"
export
resetBtn : String
resetBtn = "reset_incbtn"
data Tag = LRes | BRes | LInc | BInc | LDec | BDec | LCnt | OCnt
AreaTag Tag where
showTag LRes = "LRes"
showTag BRes = "BRes"
showTag LInc = "LInc"
showTag BInc = "BInc"
showTag LDec = "LDec"
showTag BDec = "BDec"
showTag LCnt = "LCnt"
showTag OCnt = "OCnt"
export
css : List (Rule 1)
css =
[ class resetContent !!
[ Display .= Area
(replicate 4 MinContent)
[MaxContent, MaxContent]
[ [LRes, BRes]
, [LInc, BInc]
, [LDec, BDec]
, [LCnt, OCnt]
]
, ColumnGap .= px 10
, RowGap .= px 10
, Padding .= VH (px 20) (px 10)
]
, class resetLbl !! [ GridArea .= LRes ]
, idRef btnReset !! [ GridArea .= BRes ]
, class incLbl !! [ GridArea .= LInc ]
, idRef btnInc !! [ GridArea .= BInc ]
, class decLbl !! [ GridArea .= LDec ]
, idRef btnDec !! [ GridArea .= BDec ]
, class countLbl !! [ GridArea .= LCnt ]
, idRef out !!
[ FontSize .= Large
, GridArea .= OCnt
, TextAlign .= End
]
]
|
# Simple 1-D Burger's POD-ROM
The problem we are solving is, for $ x\in [0,100] $ and $t\in [0, T]$:
\begin{align}\label{eq:burgers}
\begin{split}
w_t + \frac{1}{2}\left(w^2\right)_x &= 0.02 e^{\mu_2 x}, \\
w(0, t, \mu) &= \mu_1, \\
w(x,0,\mu) &= 1.
\end{split}
\end{align}
```python
# These are required
from time import perf_counter
import numpy as np
import matplotlib.pyplot as plt
# This is only necessary to load the previously prepared data
from torch import load
```
### This is the class managing the simulation.
Computes ROM and (optionally) FOM with finite differences. Supports loading data from my file or generating it from a list of parameter pairs.
```python
class BurgersROM:
def __init__(self):
pass
def POD_from_data(self, file, n):
'''
Loads snapshot data from my BurgersData file.
Computes POD approximation after subtracting initial condition.
'''
data = load(file)
S = data['S']
M = data['M']
tStart = perf_counter()
for i in range(12):
IC = np.ones(S.shape[1])
IC[0] = M[101*i][1]
S[101*i:101*(i+1)] = S[101*i:101*(i+1)] - IC.reshape(1,-1)
self.POD = np.linalg.svd(S.T)[0][:,:n]
tEnd = perf_counter()
print(f'POD time is {tEnd-tStart}')
def POD_from_parameters(self, N, Nt, t_max, mu_list, n):
'''
Computes a POD approximation from a user-defined list of parameters.
'''
sols = [0 for mu in mu_list]
u0 = np.ones(N)
for i, mu in enumerate(mu_list):
sols[i] = self.solve_FOM(N, Nt, t_max, mu, verbose=False)
u0[0] = mu[0]
sols[i] = sols[i] - u0.reshape(-1,1)
snapshots = np.concatenate(sols, axis=1)
self.POD = np.linalg.svd(snapshots)[0][:,:n]
def solve_FOM(self, N, Nt, t_max, mu, I=[0,100], verbose=True):
'''
Computes the (N x Nt) FOM solution at parameter mu.
'''
def f(u): return 0.5 * u**2 # Convenience function
# Define parameters
a, b = I
dt = t_max / Nt
x = np.linspace(a, b, N)
dx = (b - a) / N
# Define forcing.
g = 0.02 * np.exp(mu[1] * x)
# Set up the initial solution values.
u0 = np.ones_like(x)
u0[0] = mu[0] # BC at left endpoint
# Initialize quantities.
U = np.zeros((Nt+1, N))
U[0] = u0
# Implementation of the numerical method.
FOMtElapsed = 0
for i in range(1, Nt+1):
# Upwind conservative.
FOMtStart = perf_counter()
u = U[i-1]
uNew = u
uNew[1:] = u[1:] + dt * (-1 / dx * (f(u[1:]) - f(u[:-1])) + g[1:])
FOMtEnd = perf_counter()
FOMtElapsed = FOMtElapsed + FOMtEnd - FOMtStart
# Save the latest result.
U[i] = uNew
if verbose is True: print(f'FOM time is {FOMtElapsed}')
return U.T
def assemble(self, mu, I=[0,100]):
'''
Assembles ROM system at parameter mu.
Uses POD basis computed earlier.
'''
a, b = I
N = self.POD.shape[0]
x = np.linspace(a, b, N)
dx = (b - a) / N
def tridiag(a, b, c, k1=-1, k2=0, k3=1):
return np.diag(a, k1) + np.diag(b, k2) + np.diag(c, k3)
tStart = perf_counter()
# Precompute quantities for ROM.
PODinv = self.POD.T # Since POD comes from unitary mtx
self.gRed = PODinv @ (0.02 * np.exp(mu[1] * x))
fdiag = np.insert(np.ones(N-1), 0, 0)
FD = tridiag(-np.ones(N-1), fdiag, np.zeros(N-1)) / dx
fd = PODinv @ FD # low-dim FD matrix
u0 = np.ones_like(x)
u0[0] = mu[0] # BC at left endpoint
self.aVec = fd @ (0.5*u0**2) # rank-1 term in (u^2)_x
self.Bmat = fd @ np.diag(u0) @ self.POD # rank-2 term in (u^2)_x
outprod = np.tensordot(self.POD, self.POD, axes=0)
temp = 0.5 * outprod.diagonal(axis1=0, axis2=2).transpose((2,1,0))
self.Ctens = np.einsum('ij,jkl', fd, temp) # rank-3 term in (u^2)_x
tEnd = perf_counter()
print(f'assembly time is {tEnd-tStart}')
def solve_ROM(self, Nt, t_max, I=[0,100]):
'''
Forward Euler to solve the pre-assembled ROM.
'''
# Define parameters
a, b = I
dt = t_max / Nt
N = self.POD.shape[0]
x = np.linspace(a, b, N)
dx = (b-a) / N
# Initialize quantities.
uRed0 = np.zeros(self.POD.shape[1])
U = np.zeros((Nt+1, self.POD.shape[1]))
U[0] = uRed0
# Implementation of the numerical method.
ROMtElapsed = 0
for i in range(1,Nt+1):
ROMtStart = perf_counter()
uRed = U[i-1]
uRed2 = np.tensordot(uRed, uRed, axes=0)
uRedNew = uRed + dt * (self.gRed - self.aVec - self.Bmat @ uRed \
- np.einsum('ijk,jk', self.Ctens, uRed2))
ROMtEnd = perf_counter()
ROMtElapsed = ROMtElapsed + ROMtEnd - ROMtStart
# Save the latest result.
U[i] = uRedNew
print(f'ROM time is {ROMtElapsed}')
return U.T
def reconstruct(self, approx, mu):
'''
Reconstruct approximation to the FOM solution at mu from approx.
'''
u0 = np.ones(self.POD.shape[0])
u0[0] = mu[0]
return u0.reshape(-1,1) + self.POD @ approx
```
## Testing
We test the convergence under refinement of the reduced dimension. First, we use the POD basis computed from my saved data.
```python
x = np.linspace(0, 100, 256)
mu = [2.75, 0.00275]
p=50
rom = BurgersROM()
sol = rom.solve_FOM(256, 100, 10, mu)
rom.POD_from_data('datasets/burgersData', 3)
rom.assemble(mu)
qqq = rom.solve_ROM(100, 10)
sol4 = rom.reconstruct(qqq, mu)
rom.POD_from_data('datasets/burgersData', 10)
rom.assemble(mu)
qqq = rom.solve_ROM(100, 10)
sol10 = rom.reconstruct(qqq, mu)
rom.POD_from_data('datasets/burgersData', 30)
rom.assemble(mu)
qqq = rom.solve_ROM(100, 10)
sol30 = rom.reconstruct(qqq, mu)
fig = plt.figure(1, figsize=(8, 8))
ax = fig.add_subplot(1, 1, 1)
ax.xaxis.label.set_size(24)
ax.yaxis.label.set_size(24)
ax.tick_params(axis='x', labelsize=18)
ax.tick_params(axis='y', labelsize=18)
ax.set_xlabel('Position $x$', labelpad=15)
ax.set_ylabel('Solution $w$', labelpad=15)
ax.plot(x, sol[:,p])
ax.plot(x, sol4[:,p])
ax.plot(x, sol10[:,p])
ax.plot(x, sol30[:,p])
plt.show()
```
### Testing from parameters
Now, we test the basis computed from some random parameters.
```python
mu_list = np.array([0.5, 0.001]) + np.random.rand(10,2) * [3.5, 0.003]
x = np.linspace(0, 100, 256)
mu = [2.75, 0.00275]
p=50
rom = BurgersROM()
sol = rom.solve_FOM(256, 100, 10, mu)
rom.POD_from_parameters(256, 100, 10, mu_list, 3)
rom.assemble(mu)
qqq = rom.solve_ROM(100, 10)
sol4 = rom.reconstruct(qqq, mu)
rom.POD_from_parameters(256, 100, 10, mu_list, 10)
rom.assemble(mu)
qqq = rom.solve_ROM(100, 10)
sol10 = rom.reconstruct(qqq, mu)
rom.POD_from_parameters(256, 100, 10, mu_list, 30)
rom.assemble(mu)
qqq = rom.solve_ROM(100, 10)
sol30 = rom.reconstruct(qqq, mu)
fig = plt.figure(1, figsize=(8, 8))
ax = fig.add_subplot(1, 1, 1)
ax.xaxis.label.set_size(24)
ax.yaxis.label.set_size(24)
ax.tick_params(axis='x', labelsize=18)
ax.tick_params(axis='y', labelsize=18)
ax.set_xlabel('Position $x$', labelpad=15)
ax.set_ylabel('Solution $w$', labelpad=15)
ax.plot(x, sol[:,p])
ax.plot(x, sol4[:,p])
ax.plot(x, sol10[:,p])
ax.plot(x, sol30[:,p])
plt.show()
```
|
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.666
W : Type ?u.669
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
e : X ββ Y
β’ IsProperMap βe
[PROOFSTEP]
rw [isProperMap_iff_clusterPt]
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.666
W : Type ?u.669
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
e : X ββ Y
β’ Continuous βe β§ β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± βe β β x, βe x = y β§ ClusterPt x β±
[PROOFSTEP]
refine β¨e.continuous, fun β± y β¦ ?_β©
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.666
W : Type ?u.669
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
e : X ββ Y
β± : Filter X
y : Y
β’ MapClusterPt y β± βe β β x, βe x = y β§ ClusterPt x β±
[PROOFSTEP]
simp_rw [MapClusterPt, ClusterPt, β Filter.push_pull', map_neBot_iff, e.comap_nhds_eq, β e.coe_toEquiv, β
e.eq_symm_apply, exists_eq_left]
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.666
W : Type ?u.669
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
e : X ββ Y
β± : Filter X
y : Y
β’ NeBot (π (β(Homeomorph.symm e) y) β β±) β NeBot (π (βe.symm y) β β±)
[PROOFSTEP]
exact id
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.2964
W : Type ?u.2967
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
β’ IsClosedMap f
[PROOFSTEP]
rw [isClosedMap_iff_clusterPt]
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.2964
W : Type ?u.2967
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
β’ β (s : Set X) (y : Y), MapClusterPt y (π s) f β β x, f x = y β§ ClusterPt x (π s)
[PROOFSTEP]
exact fun s y β¦ h.clusterPt_of_mapClusterPt (β± := π s) (y := y)
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
β’ IsProperMap f β Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
rw [isProperMap_iff_clusterPt]
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
β’ (Continuous f β§ β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±) β
Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
refine and_congr_right (fun _ β¦ ?_)
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
β’ (β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±) β
β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
constructor
[GOAL]
case mp
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
β’ (β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±) β
β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
intro H
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
β’ (β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x) β
β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±
[PROOFSTEP]
intro H
[GOAL]
case mp
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±
β’ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
intro π° y (hY : (Ultrafilter.map f π° : Filter Y) β€ _)
[GOAL]
case mp
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±
π° : Ultrafilter X
y : Y
hY : β(Ultrafilter.map f π°) β€ π y
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
simp_rw [β Ultrafilter.clusterPt_iff] at hY β’
[GOAL]
case mp
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±
π° : Ultrafilter X
y : Y
hY : ClusterPt y β(Ultrafilter.map f π°)
β’ β x, f x = y β§ ClusterPt x βπ°
[PROOFSTEP]
exact H hY
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
β’ β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±
[PROOFSTEP]
simp_rw [MapClusterPt, ClusterPt, β Filter.push_pull', map_neBot_iff, β exists_ultrafilter_iff, forall_exists_index]
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
β’ β β¦β± : Filter Xβ¦ β¦y : Yβ¦ (x : Ultrafilter X), βx β€ comap f (π y) β β± β β x, f x = y β§ β u, βu β€ π x β β±
[PROOFSTEP]
intro β± y π° hy
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
β± : Filter X
y : Y
π° : Ultrafilter X
hy : βπ° β€ comap f (π y) β β±
β’ β x, f x = y β§ β u, βu β€ π x β β±
[PROOFSTEP]
rcases H (tendsto_iff_comap.mpr <| hy.trans inf_le_left) with β¨x, hxy, hxβ©
[GOAL]
case mpr.intro.intro
X : Type u_1
Y : Type u_2
Z : Type ?u.3327
W : Type ?u.3330
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
xβ : Continuous f
H : β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
β± : Filter X
y : Y
π° : Ultrafilter X
hy : βπ° β€ comap f (π y) β β±
x : X
hxy : f x = y
hx : βπ° β€ π x
β’ β x, f x = y β§ β u, βu β€ π x β β±
[PROOFSTEP]
exact β¨x, hxy, π°, le_inf hx (hy.trans inf_le_right)β©
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : IsProperMap f
hg : IsProperMap g
β’ IsProperMap (Prod.map f g)
[PROOFSTEP]
simp_rw [isProperMap_iff_ultrafilter] at hf hg β’
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
β’ Continuous (Prod.map f g) β§
β β¦π° : Ultrafilter (X Γ Z)β¦ β¦y : Y Γ Wβ¦, Tendsto (Prod.map f g) (βπ°) (π y) β β x, Prod.map f g x = y β§ βπ° β€ π x
[PROOFSTEP]
constructor
-- Continuity is clear.
[GOAL]
case left
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
β’ Continuous (Prod.map f g)
[PROOFSTEP]
exact
hf.1.prod_map
hg.1
-- Let `π° : Ultrafilter (X Γ Z)`, and assume that `f Γ g` tends to some `(y, w) : Y Γ W`
-- along `π°`.
[GOAL]
case right
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
β’ β β¦π° : Ultrafilter (X Γ Z)β¦ β¦y : Y Γ Wβ¦, Tendsto (Prod.map f g) (βπ°) (π y) β β x, Prod.map f g x = y β§ βπ° β€ π x
[PROOFSTEP]
intro π° β¨y, wβ© hyw
[GOAL]
case right
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (Prod.map f g) (βπ°) (π (y, w))
β’ β x, Prod.map f g x = (y, w) β§ βπ° β€ π x
[PROOFSTEP]
simp_rw [nhds_prod_eq, tendsto_prod_iff'] at hyw
[GOAL]
case right
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
β’ β x, Prod.map f g x = (y, w) β§ βπ° β€ π x
[PROOFSTEP]
rcases hf.2 (show Tendsto f (Ultrafilter.map fst π°) (π y) by simpa using hyw.1) with β¨x, hxy, hxβ©
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
β’ Tendsto f (β(Ultrafilter.map fst π°)) (π y)
[PROOFSTEP]
simpa using hyw.1
[GOAL]
case right.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
x : X
hxy : f x = y
hx : β(Ultrafilter.map fst π°) β€ π x
β’ β x, Prod.map f g x = (y, w) β§ βπ° β€ π x
[PROOFSTEP]
rcases hg.2 (show Tendsto g (Ultrafilter.map snd π°) (π w) by simpa using hyw.2) with
β¨z, hzw, hzβ©
-- By the properties of the product topology, that means that `π°` tends to `(x, z)`,
-- which completes the proof since `(f Γ g)(x, z) = (y, w)`.
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
x : X
hxy : f x = y
hx : β(Ultrafilter.map fst π°) β€ π x
β’ Tendsto g (β(Ultrafilter.map snd π°)) (π w)
[PROOFSTEP]
simpa using hyw.2
[GOAL]
case right.intro.intro.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
x : X
hxy : f x = y
hx : β(Ultrafilter.map fst π°) β€ π x
z : Z
hzw : g z = w
hz : β(Ultrafilter.map snd π°) β€ π z
β’ β x, Prod.map f g x = (y, w) β§ βπ° β€ π x
[PROOFSTEP]
refine β¨β¨x, zβ©, Prod.ext hxy hzw, ?_β©
[GOAL]
case right.intro.intro.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
x : X
hxy : f x = y
hx : β(Ultrafilter.map fst π°) β€ π x
z : Z
hzw : g z = w
hz : β(Ultrafilter.map snd π°) β€ π z
β’ βπ° β€ π (x, z)
[PROOFSTEP]
rw [nhds_prod_eq, le_prod]
[GOAL]
case right.intro.intro.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
W : Type u_4
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
g : Z β W
hf : Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
hg : Continuous g β§ β β¦π° : Ultrafilter Zβ¦ β¦y : Wβ¦, Tendsto g (βπ°) (π y) β β x, g x = y β§ βπ° β€ π x
π° : Ultrafilter (X Γ Z)
y : Y
w : W
hyw : Tendsto (fun n => (Prod.map f g n).fst) (βπ°) (π y) β§ Tendsto (fun n => (Prod.map f g n).snd) (βπ°) (π w)
x : X
hxy : f x = y
hx : β(Ultrafilter.map fst π°) β€ π x
z : Z
hzw : g z = w
hz : β(Ultrafilter.map snd π°) β€ π z
β’ Tendsto fst (βπ°) (π x) β§ Tendsto snd (βπ°) (π z)
[PROOFSTEP]
exact β¨hx, hzβ©
[GOAL]
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h : β (i : ΞΉ), IsProperMap (f i)
β’ IsProperMap fun x i => f i (x i)
[PROOFSTEP]
simp_rw [isProperMap_iff_ultrafilter] at h β’
[GOAL]
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
β’ (Continuous fun x i => f i (x i)) β§
β β¦π° : Ultrafilter ((i : ΞΉ) β X i)β¦ β¦y : (i : ΞΉ) β Y iβ¦,
Tendsto (fun x i => f i (x i)) (βπ°) (π y) β β x, (fun i => f i (x i)) = y β§ βπ° β€ π x
[PROOFSTEP]
constructor
-- Continuity is clear.
[GOAL]
case left
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
β’ Continuous fun x i => f i (x i)
[PROOFSTEP]
exact
continuous_pi fun i β¦
(h i).1.comp
(continuous_apply i)
-- Let `π° : Ultrafilter (Ξ i, X i)`, and assume that `Ξ i, f i` tends to some `y : Ξ i, Y i`
-- along `π°`.
[GOAL]
case right
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
β’ β β¦π° : Ultrafilter ((i : ΞΉ) β X i)β¦ β¦y : (i : ΞΉ) β Y iβ¦,
Tendsto (fun x i => f i (x i)) (βπ°) (π y) β β x, (fun i => f i (x i)) = y β§ βπ° β€ π x
[PROOFSTEP]
intro π° y hy
[GOAL]
case right
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
π° : Ultrafilter ((i : ΞΉ) β X i)
y : (i : ΞΉ) β Y i
hy : Tendsto (fun x i => f i (x i)) (βπ°) (π y)
β’ β x, (fun i => f i (x i)) = y β§ βπ° β€ π x
[PROOFSTEP]
have : β i, Tendsto (f i) (Ultrafilter.map (eval i) π°) (π (y i)) := by simpa [tendsto_pi_nhds] using hy
[GOAL]
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
π° : Ultrafilter ((i : ΞΉ) β X i)
y : (i : ΞΉ) β Y i
hy : Tendsto (fun x i => f i (x i)) (βπ°) (π y)
β’ β (i : ΞΉ), Tendsto (f i) (β(Ultrafilter.map (eval i) π°)) (π (y i))
[PROOFSTEP]
simpa [tendsto_pi_nhds] using hy
[GOAL]
case right
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
π° : Ultrafilter ((i : ΞΉ) β X i)
y : (i : ΞΉ) β Y i
hy : Tendsto (fun x i => f i (x i)) (βπ°) (π y)
this : β (i : ΞΉ), Tendsto (f i) (β(Ultrafilter.map (eval i) π°)) (π (y i))
β’ β x, (fun i => f i (x i)) = y β§ βπ° β€ π x
[PROOFSTEP]
choose x hxy hx using fun i β¦
(h i).2
(this i)
-- By the properties of the product topology, that means that `π°` tends to `x`,
-- which completes the proof since `(Ξ i, f i) x = y`.
[GOAL]
case right
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
π° : Ultrafilter ((i : ΞΉ) β X i)
y : (i : ΞΉ) β Y i
hy : Tendsto (fun x i => f i (x i)) (βπ°) (π y)
this : β (i : ΞΉ), Tendsto (f i) (β(Ultrafilter.map (eval i) π°)) (π (y i))
x : (i : ΞΉ) β X i
hxy : β (i : ΞΉ), f i (x i) = y i
hx : β (i : ΞΉ), β(Ultrafilter.map (eval i) π°) β€ π (x i)
β’ β x, (fun i => f i (x i)) = y β§ βπ° β€ π x
[PROOFSTEP]
refine β¨x, funext hxy, ?_β©
[GOAL]
case right
Xβ : Type ?u.30436
Yβ : Type ?u.30439
Z : Type ?u.30442
W : Type ?u.30445
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
ΞΉ : Type u_3
X : ΞΉ β Type u_1
Y : ΞΉ β Type u_2
instβΒΉ : (i : ΞΉ) β TopologicalSpace (X i)
instβ : (i : ΞΉ) β TopologicalSpace (Y i)
f : (i : ΞΉ) β X i β Y i
h :
β (i : ΞΉ),
Continuous (f i) β§ β β¦π° : Ultrafilter (X i)β¦ β¦y : Y iβ¦, Tendsto (f i) (βπ°) (π y) β β x, f i x = y β§ βπ° β€ π x
π° : Ultrafilter ((i : ΞΉ) β X i)
y : (i : ΞΉ) β Y i
hy : Tendsto (fun x i => f i (x i)) (βπ°) (π y)
this : β (i : ΞΉ), Tendsto (f i) (β(Ultrafilter.map (eval i) π°)) (π (y i))
x : (i : ΞΉ) β X i
hxy : β (i : ΞΉ), f i (x i) = y i
hx : β (i : ΞΉ), β(Ultrafilter.map (eval i) π°) β€ π (x i)
β’ βπ° β€ π x
[PROOFSTEP]
rwa [nhds_pi, le_pi]
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.36187
W : Type ?u.36190
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
K : Set Y
hK : IsCompact K
β’ IsCompact (f β»ΒΉ' K)
[PROOFSTEP]
rw [isCompact_iff_ultrafilter_le_nhds]
-- Let `π° β€ π (f β»ΒΉ' K)` an ultrafilter.
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.36187
W : Type ?u.36190
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
K : Set Y
hK : IsCompact K
β’ β (f_1 : Ultrafilter X), βf_1 β€ π (f β»ΒΉ' K) β β a, a β f β»ΒΉ' K β§ βf_1 β€ π a
[PROOFSTEP]
intro π° hπ°
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.36187
W : Type ?u.36190
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
K : Set Y
hK : IsCompact K
π° : Ultrafilter X
hπ° : βπ° β€ π (f β»ΒΉ' K)
β’ β a, a β f β»ΒΉ' K β§ βπ° β€ π a
[PROOFSTEP]
rw [β comap_principal, β map_le_iff_le_comap, β Ultrafilter.coe_map] at hπ°
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.36187
W : Type ?u.36190
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
K : Set Y
hK : IsCompact K
π° : Ultrafilter X
hπ° : β(Ultrafilter.map f π°) β€ π K
β’ β a, a β f β»ΒΉ' K β§ βπ° β€ π a
[PROOFSTEP]
rcases hK.ultrafilter_le_nhds _ hπ° with
β¨y, hyK, hyβ©
-- Then, by properness of `f`, that means that `π°` tends to some `x β f β»ΒΉ' {y} β f β»ΒΉ' K`,
-- which completes the proof.
[GOAL]
case intro.intro
X : Type u_1
Y : Type u_2
Z : Type ?u.36187
W : Type ?u.36190
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
K : Set Y
hK : IsCompact K
π° : Ultrafilter X
hπ° : β(Ultrafilter.map f π°) β€ π K
y : Y
hyK : y β K
hy : β(Ultrafilter.map f π°) β€ π y
β’ β a, a β f β»ΒΉ' K β§ βπ° β€ π a
[PROOFSTEP]
rcases h.ultrafilter_le_nhds_of_tendsto hy with β¨x, rfl, hxβ©
[GOAL]
case intro.intro.intro.intro
X : Type u_1
Y : Type u_2
Z : Type ?u.36187
W : Type ?u.36190
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
h : IsProperMap f
K : Set Y
hK : IsCompact K
π° : Ultrafilter X
hπ° : β(Ultrafilter.map f π°) β€ π K
x : X
hx : βπ° β€ π x
hyK : f x β K
hy : β(Ultrafilter.map f π°) β€ π (f x)
β’ β a, a β f β»ΒΉ' K β§ βπ° β€ π a
[PROOFSTEP]
exact β¨x, hyK, hxβ©
[GOAL]
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
β’ IsProperMap f β Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
[PROOFSTEP]
constructor
[GOAL]
case mp
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
β’ IsProperMap f β Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
[PROOFSTEP]
intro H
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
β’ (Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})) β IsProperMap f
[PROOFSTEP]
intro H
[GOAL]
case mp
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : IsProperMap f
β’ Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
[PROOFSTEP]
exact β¨H.continuous, H.isClosedMap, fun y β¦ H.isCompact_preimage isCompact_singletonβ©
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β’ IsProperMap f
[PROOFSTEP]
rw [isProperMap_iff_clusterPt]
-- Let `β± : Filter X` and `y` some cluster point of `map f β±`.
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β’ Continuous f β§ β β¦β± : Filter Xβ¦ β¦y : Yβ¦, MapClusterPt y β± f β β x, f x = y β§ ClusterPt x β±
[PROOFSTEP]
refine
β¨H.1, fun β± y hy β¦ ?_β©
-- That means that the singleton `pure y` meets the "closure" of `map f β±`, by which we mean
-- `Filter.lift' (map f β±) closure`. But `f` is closed, so
-- `closure (map f β±) = map f (closure β±)` (see `IsClosedMap.lift'_closure_map_eq`).
-- Thus `map f (closure β± β π (f β»ΒΉ' {y})) = map f (closure β±) β π {y} β β₯`, hence
-- `closure β± β π (f β»ΒΉ' {y}) β β₯`.
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β± : Filter X
y : Y
hy : MapClusterPt y β± f
β’ β x, f x = y β§ ClusterPt x β±
[PROOFSTEP]
rw [H.2.1.mapClusterPt_iff_lift'_closure H.1] at hy
[GOAL]
case mpr
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β± : Filter X
y : Y
hy : NeBot (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
β’ β x, f x = y β§ ClusterPt x β±
[PROOFSTEP]
rcases H.2.2 y (f := Filter.lift' β± closure β π (f β»ΒΉ' { y })) inf_le_right with β¨x, hxy, hxβ©
[GOAL]
case mpr.intro.intro
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β± : Filter X
y : Y
hy : NeBot (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
x : X
hxy : x β f β»ΒΉ' {y}
hx : ClusterPt x (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
β’ β x, f x = y β§ ClusterPt x β±
[PROOFSTEP]
refine
β¨x, hxy, ?_β©
-- In particular `x` is a cluster point of `closure β±`. Since cluster points of `closure β±`
-- are exactly cluster points of `β±` (see `clusterPt_lift'_closure_iff`), this completes
-- the proof.
[GOAL]
case mpr.intro.intro
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β± : Filter X
y : Y
hy : NeBot (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
x : X
hxy : x β f β»ΒΉ' {y}
hx : ClusterPt x (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
β’ ClusterPt x β±
[PROOFSTEP]
rw [β clusterPt_lift'_closure_iff]
[GOAL]
case mpr.intro.intro
X : Type u_1
Y : Type u_2
Z : Type ?u.36806
W : Type ?u.36809
instβΒ³ : TopologicalSpace X
instβΒ² : TopologicalSpace Y
instβΒΉ : TopologicalSpace Z
instβ : TopologicalSpace W
f : X β Y
H : Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})
β± : Filter X
y : Y
hy : NeBot (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
x : X
hxy : x β f β»ΒΉ' {y}
hx : ClusterPt x (Filter.lift' β± closure β π (f β»ΒΉ' {y}))
β’ ClusterPt x (Filter.lift' β± closure)
[PROOFSTEP]
exact hx.mono inf_le_left
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.37764
W : Type ?u.37767
instββ΄ : TopologicalSpace X
instβΒ³ : TopologicalSpace Y
instβΒ² : TopologicalSpace Z
instβΒΉ : TopologicalSpace W
f : X β Y
instβ : T1Space Y
β’ IsProperMap f β Continuous f β§ IsClosedMap f β§ Tendsto f (cocompact X) cofinite
[PROOFSTEP]
simp_rw [isProperMap_iff_isClosedMap_and_compact_fibers, Tendsto, le_cofinite_iff_compl_singleton_mem, mem_map,
preimage_compl]
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.37764
W : Type ?u.37767
instββ΄ : TopologicalSpace X
instβΒ³ : TopologicalSpace Y
instβΒ² : TopologicalSpace Z
instβΒΉ : TopologicalSpace W
f : X β Y
instβ : T1Space Y
β’ (Continuous f β§ IsClosedMap f β§ β (y : Y), IsCompact (f β»ΒΉ' {y})) β
Continuous f β§ IsClosedMap f β§ β (x : Y), (f β»ΒΉ' {x})αΆ β cocompact X
[PROOFSTEP]
refine and_congr_right fun f_cont β¦ and_congr_right fun _ β¦ β¨fun H y β¦ (H y).compl_mem_cocompact, fun H y β¦ ?_β©
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.37764
W : Type ?u.37767
instββ΄ : TopologicalSpace X
instβΒ³ : TopologicalSpace Y
instβΒ² : TopologicalSpace Z
instβΒΉ : TopologicalSpace W
f : X β Y
instβ : T1Space Y
f_cont : Continuous f
xβ : IsClosedMap f
H : β (x : Y), (f β»ΒΉ' {x})αΆ β cocompact X
y : Y
β’ IsCompact (f β»ΒΉ' {y})
[PROOFSTEP]
rcases mem_cocompact.mp (H y) with β¨K, hK, hKyβ©
[GOAL]
case intro.intro
X : Type u_2
Y : Type u_1
Z : Type ?u.37764
W : Type ?u.37767
instββ΄ : TopologicalSpace X
instβΒ³ : TopologicalSpace Y
instβΒ² : TopologicalSpace Z
instβΒΉ : TopologicalSpace W
f : X β Y
instβ : T1Space Y
f_cont : Continuous f
xβ : IsClosedMap f
H : β (x : Y), (f β»ΒΉ' {x})αΆ β cocompact X
y : Y
K : Set X
hK : IsCompact K
hKy : KαΆ β (f β»ΒΉ' {y})αΆ
β’ IsCompact (f β»ΒΉ' {y})
[PROOFSTEP]
exact isCompact_of_isClosed_subset hK (isClosed_singleton.preimage f_cont) (compl_le_compl_iff_le.mp hKy)
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
β’ IsProperMap f β Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
[PROOFSTEP]
constructor
[GOAL]
case mp
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
β’ IsProperMap f β Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
[PROOFSTEP]
intro H
[GOAL]
case mpr
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
β’ (Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)) β IsProperMap f
[PROOFSTEP]
intro H
[GOAL]
case mp
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : IsProperMap f
β’ Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
[PROOFSTEP]
exact β¨H.continuous, fun K hK β¦ H.isCompact_preimage hKβ©
[GOAL]
case mpr
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
β’ IsProperMap f
[PROOFSTEP]
rw [isProperMap_iff_ultrafilter]
-- Let `π° : Ultrafilter X`, and assume that `f` tends to some `y` along `π°`.
[GOAL]
case mpr
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
β’ Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
refine
β¨H.1, fun π° y hy β¦ ?_β©
-- Pick `K` some compact neighborhood of `y`, which exists by local compactness.
[GOAL]
case mpr
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
rcases exists_compact_mem_nhds y with
β¨K, hK, hKyβ©
-- Then `map f π° β€ π y β€ π K`, hence `π° β€ π (f β»ΒΉ' K)`
[GOAL]
case mpr.intro.intro
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
K : Set Y
hK : IsCompact K
hKy : K β π y
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
have : π° β€ π (f β»ΒΉ' K) := by
simpa only [β comap_principal, β tendsto_iff_comap] using
hy.mono_right
(le_principal_iff.mpr hKy)
-- By compactness of `f β»ΒΉ' K`, `π°` converges to some `x β f β»ΒΉ' K`.
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
K : Set Y
hK : IsCompact K
hKy : K β π y
β’ βπ° β€ π (f β»ΒΉ' K)
[PROOFSTEP]
simpa only [β comap_principal, β tendsto_iff_comap] using
hy.mono_right
(le_principal_iff.mpr hKy)
-- By compactness of `f β»ΒΉ' K`, `π°` converges to some `x β f β»ΒΉ' K`.
[GOAL]
case mpr.intro.intro
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
K : Set Y
hK : IsCompact K
hKy : K β π y
this : βπ° β€ π (f β»ΒΉ' K)
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
rcases(H.2 hK).ultrafilter_le_nhds _ this with
β¨x, -, hxβ©
-- Finally, `f` tends to `f x` along `π°` by continuity, thus `f x = y`.
[GOAL]
case mpr.intro.intro.intro.intro
X : Type u_2
Y : Type u_1
Z : Type ?u.39226
W : Type ?u.39229
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
H : Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
K : Set Y
hK : IsCompact K
hKy : K β π y
this : βπ° β€ π (f β»ΒΉ' K)
x : X
hx : βπ° β€ π x
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
refine β¨x, tendsto_nhds_unique ((H.1.tendsto _).comp hx) hy, hxβ©
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.49990
W : Type ?u.49993
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
β’ IsProperMap f β Continuous f β§ Tendsto f (cocompact X) (cocompact Y)
[PROOFSTEP]
simp_rw [isProperMap_iff_isCompact_preimage, hasBasis_cocompact.tendsto_right_iff, β mem_preimage, eventually_mem_set,
preimage_compl]
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.49990
W : Type ?u.49993
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
β’ (Continuous f β§ β β¦K : Set Yβ¦, IsCompact K β IsCompact (f β»ΒΉ' K)) β
Continuous f β§ β (i : Set Y), IsCompact i β (f β»ΒΉ' i)αΆ β cocompact X
[PROOFSTEP]
refine and_congr_right fun f_cont β¦ β¨fun H K hK β¦ (H hK).compl_mem_cocompact, fun H K hK β¦ ?_β©
[GOAL]
X : Type u_2
Y : Type u_1
Z : Type ?u.49990
W : Type ?u.49993
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
f_cont : Continuous f
H : β (i : Set Y), IsCompact i β (f β»ΒΉ' i)αΆ β cocompact X
K : Set Y
hK : IsCompact K
β’ IsCompact (f β»ΒΉ' K)
[PROOFSTEP]
rcases mem_cocompact.mp (H K hK) with β¨K', hK', hK'yβ©
[GOAL]
case intro.intro
X : Type u_2
Y : Type u_1
Z : Type ?u.49990
W : Type ?u.49993
instββ΅ : TopologicalSpace X
instββ΄ : TopologicalSpace Y
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
f : X β Y
instβΒΉ : T2Space Y
instβ : LocallyCompactSpace Y
f_cont : Continuous f
H : β (i : Set Y), IsCompact i β (f β»ΒΉ' i)αΆ β cocompact X
K : Set Y
hK : IsCompact K
K' : Set X
hK' : IsCompact K'
hK'y : K'αΆ β (f β»ΒΉ' K)αΆ
β’ IsCompact (f β»ΒΉ' K)
[PROOFSTEP]
exact isCompact_of_isClosed_subset hK' (hK.isClosed.preimage f_cont) (compl_le_compl_iff_le.mp hK'y)
[GOAL]
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ IsProperMap f β Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
constructor
[GOAL]
case mp
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ IsProperMap f β Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
intro H
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ Continuous f β§ IsClosedMap (Prod.map f id) β IsProperMap f
[PROOFSTEP]
intro H
[GOAL]
case mp
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : IsProperMap f
β’ Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
exact β¨H.continuous, H.universally_closed _β©
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
β’ IsProperMap f
[PROOFSTEP]
rw [isProperMap_iff_ultrafilter]
-- Let `π° : Ultrafilter X`, and assume that `f` tends to some `y` along `π°`.
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
β’ Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
refine
β¨H.1, fun π° y hy β¦ ?_β©
-- In `X Γ Filter X`, consider the closed set `F := closure {(x, β±) | β± = pure x}`
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
let F : Set (X Γ Filter X) :=
closure
{xβ± | xβ±.2 = pure xβ±.1}
-- Since `f Γ id` is closed, the set `(f Γ id) '' F` is also closed.
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
have := H.2 F isClosed_closure
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
have : (y, βπ°) β Prod.map f id '' F :=
-- Note that, by the properties of the topology on `Filter X`, the function `pure : X β Filter X`
-- tends to the point `π°` of `Filter X` along the filter `π°` on `X`. Since `f` tends to `y` along
-- `π°`, we get that the function `(f, pure) : X β (Y, Filter X)` tends to `(y, π°)` along
-- `π°`. Furthermore, each `(f, pure)(x) = (f Γ id)(x, pure x)` is clearly an element of
-- the closed set `(f Γ id) '' F`, thus the limit `(y, π°)` also belongs to that set.this.mem_of_tendsto
(hy.prod_mk_nhds (Filter.tendsto_pure_self (π° : Filter X)))
(eventually_of_forall fun x β¦ β¨β¨x, pure xβ©, subset_closure rfl, rflβ©)
-- The above shows that `(y, π°) = (f x, π°)`, for some `x : X` such that `(x, π°) β F`.
[GOAL]
case mpr
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
thisβ : IsClosed (Prod.map f id '' F)
this : (y, βπ°) β Prod.map f id '' F
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
rcases this with
β¨β¨x, _β©, hx, β¨_, _β©β©
-- We already know that `f x = y`, so to finish the proof we just have to check that `π°` tends
-- to `x`. So, for `U β π x` arbitrary, let's show that `U β π°`. Since `π°` is a ultrafilter,
-- it is enough to show that `UαΆ` is not in `π°`.
[GOAL]
case mpr.intro.mk.intro.refl
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (βπ°) (π (f x))
hx : (x, π°.1) β F
β’ β x_1, f x_1 = f x β§ βπ° β€ π x_1
[PROOFSTEP]
refine β¨x, rfl, fun U hU β¦ Ultrafilter.compl_not_mem_iff.mp fun hUc β¦ ?_β©
[GOAL]
case mpr.intro.mk.intro.refl
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (βπ°) (π (f x))
hx : (x, π°.1) β F
U : Set X
hU : U β π x
hUc : UαΆ β π°
β’ False
[PROOFSTEP]
rw [mem_closure_iff_nhds] at hx
[GOAL]
case mpr.intro.mk.intro.refl
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (βπ°) (π (f x))
hx : β (t : Set (X Γ Filter X)), t β π (x, π°.1) β Set.Nonempty (t β© {xβ± | xβ±.snd = pure xβ±.fst})
U : Set X
hU : U β π x
hUc : UαΆ β π°
β’ False
[PROOFSTEP]
rcases hx (U ΓΛ’ {π’ | UαΆ β π’}) (prod_mem_nhds hU (isOpen_setOf_mem.mem_nhds hUc)) with
β¨β¨z, π’β©, β¨β¨hz : z β U, hz' : UαΆ β π’β©, rfl : π’ = pure zβ©β©
[GOAL]
case mpr.intro.mk.intro.refl.intro.mk.intro.intro
Xβ : Type ?u.52247
Yβ : Type ?u.52250
Z : Type ?u.52253
W : Type ?u.52256
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
F : Set (X Γ Filter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (βπ°) (π (f x))
hx : β (t : Set (X Γ Filter X)), t β π (x, π°.1) β Set.Nonempty (t β© {xβ± | xβ±.snd = pure xβ±.fst})
U : Set X
hU : U β π x
hUc : UαΆ β π°
z : X
hz : z β U
hz' : UαΆ β pure z
β’ False
[PROOFSTEP]
exact hz' hz
[GOAL]
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ IsProperMap f β Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
constructor
[GOAL]
case mp
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ IsProperMap f β Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
intro H
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ Continuous f β§ IsClosedMap (Prod.map f id) β IsProperMap f
[PROOFSTEP]
intro H
[GOAL]
case mp
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : IsProperMap f
β’ Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
exact β¨H.continuous, H.universally_closed _β©
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
β’ IsProperMap f
[PROOFSTEP]
rw [isProperMap_iff_ultrafilter]
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
β’ Continuous f β§ β β¦π° : Ultrafilter Xβ¦ β¦y : Yβ¦, Tendsto f (βπ°) (π y) β β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
refine β¨H.1, fun π° y hy β¦ ?_β©
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
let F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.2 = pure xβ±.1}
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
have := H.2 F isClosed_closure
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
have : (y, π°) β Prod.map f id '' F :=
this.mem_of_tendsto (hy.prod_mk_nhds (Ultrafilter.tendsto_pure_self π°))
(eventually_of_forall fun x β¦ β¨β¨x, pure xβ©, subset_closure rfl, rflβ©)
[GOAL]
case mpr
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
π° : Ultrafilter X
y : Y
hy : Tendsto f (βπ°) (π y)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
thisβ : IsClosed (Prod.map f id '' F)
this : (y, π°) β Prod.map f id '' F
β’ β x, f x = y β§ βπ° β€ π x
[PROOFSTEP]
rcases this with β¨β¨x, _β©, hx, β¨_, _β©β©
[GOAL]
case mpr.intro.mk.intro.refl
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
sndβ : Ultrafilter X
hx : (x, sndβ) β F
hy : Tendsto f (β(id sndβ)) (π (f x))
β’ β x_1, f x_1 = f x β§ β(id sndβ) β€ π x_1
[PROOFSTEP]
refine β¨x, rfl, fun U hU β¦ Ultrafilter.compl_not_mem_iff.mp fun hUc β¦ ?_β©
[GOAL]
case mpr.intro.mk.intro.refl
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
sndβ : Ultrafilter X
hx : (x, sndβ) β F
hy : Tendsto f (β(id sndβ)) (π (f x))
U : Set X
hU : U β π x
hUc : UαΆ β id sndβ
β’ False
[PROOFSTEP]
rw [mem_closure_iff_nhds] at hx
[GOAL]
case mpr.intro.mk.intro.refl
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
sndβ : Ultrafilter X
hx : β (t : Set (X Γ Ultrafilter X)), t β π (x, sndβ) β Set.Nonempty (t β© {xβ± | xβ±.snd = pure xβ±.fst})
hy : Tendsto f (β(id sndβ)) (π (f x))
U : Set X
hU : U β π x
hUc : UαΆ β id sndβ
β’ False
[PROOFSTEP]
rcases hx (U ΓΛ’ {π’ | UαΆ β π’}) (prod_mem_nhds hU ((ultrafilter_isOpen_basic _).mem_nhds hUc)) with
β¨β¨y, π’β©, β¨β¨hy : y β U, hy' : UαΆ β π’β©, rfl : π’ = pure yβ©β©
[GOAL]
case mpr.intro.mk.intro.refl.intro.mk.intro.intro
Xβ : Type ?u.54240
Yβ : Type ?u.54243
Z : Type ?u.54246
W : Type ?u.54249
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ IsClosedMap (Prod.map f id)
F : Set (X Γ Ultrafilter X) := closure {xβ± | xβ±.snd = pure xβ±.fst}
this : IsClosed (Prod.map f id '' F)
x : X
sndβ : Ultrafilter X
hx : β (t : Set (X Γ Ultrafilter X)), t β π (x, sndβ) β Set.Nonempty (t β© {xβ± | xβ±.snd = pure xβ±.fst})
hyβ : Tendsto f (β(id sndβ)) (π (f x))
U : Set X
hU : U β π x
hUc : UαΆ β id sndβ
y : X
hy : y β U
hy' : UαΆ β pure y
β’ False
[PROOFSTEP]
exact hy' hy
[GOAL]
Xβ : Type ?u.56079
Yβ : Type ?u.56082
Z : Type ?u.56085
W : Type ?u.56088
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ IsProperMap f β Continuous f β§ β (Z : Type u) [inst : TopologicalSpace Z], IsClosedMap (Prod.map f id)
[PROOFSTEP]
constructor
[GOAL]
case mp
Xβ : Type ?u.56079
Yβ : Type ?u.56082
Z : Type ?u.56085
W : Type ?u.56088
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ IsProperMap f β Continuous f β§ β (Z : Type u) [inst : TopologicalSpace Z], IsClosedMap (Prod.map f id)
[PROOFSTEP]
intro H
[GOAL]
case mpr
Xβ : Type ?u.56079
Yβ : Type ?u.56082
Z : Type ?u.56085
W : Type ?u.56088
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
β’ (Continuous f β§ β (Z : Type u) [inst : TopologicalSpace Z], IsClosedMap (Prod.map f id)) β IsProperMap f
[PROOFSTEP]
intro H
[GOAL]
case mp
Xβ : Type ?u.56079
Yβ : Type ?u.56082
Z : Type ?u.56085
W : Type ?u.56088
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : IsProperMap f
β’ Continuous f β§ β (Z : Type u) [inst : TopologicalSpace Z], IsClosedMap (Prod.map f id)
[PROOFSTEP]
exact β¨H.continuous, fun Z β¦ H.universally_closed _β©
[GOAL]
case mpr
Xβ : Type ?u.56079
Yβ : Type ?u.56082
Z : Type ?u.56085
W : Type ?u.56088
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ β (Z : Type u) [inst : TopologicalSpace Z], IsClosedMap (Prod.map f id)
β’ IsProperMap f
[PROOFSTEP]
rw [isProperMap_iff_isClosedMap_ultrafilter]
[GOAL]
case mpr
Xβ : Type ?u.56079
Yβ : Type ?u.56082
Z : Type ?u.56085
W : Type ?u.56088
instββ΅ : TopologicalSpace Xβ
instββ΄ : TopologicalSpace Yβ
instβΒ³ : TopologicalSpace Z
instβΒ² : TopologicalSpace W
fβ : Xβ β Yβ
X : Type u
Y : Type v
instβΒΉ : TopologicalSpace X
instβ : TopologicalSpace Y
f : X β Y
H : Continuous f β§ β (Z : Type u) [inst : TopologicalSpace Z], IsClosedMap (Prod.map f id)
β’ Continuous f β§ IsClosedMap (Prod.map f id)
[PROOFSTEP]
exact β¨H.1, H.2 _β©
|
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : C
β’ NatTrans.app (ofRightAdjoint i).unit (i.obj ((leftAdjoint i).obj X)) =
i.map ((leftAdjoint i).map (NatTrans.app (ofRightAdjoint i).unit X))
[PROOFSTEP]
rw [β cancel_mono (i.map ((ofRightAdjoint i).counit.app ((leftAdjoint i).obj X))), β i.map_comp]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : C
β’ NatTrans.app (ofRightAdjoint i).unit (i.obj ((leftAdjoint i).obj X)) β«
i.map (NatTrans.app (ofRightAdjoint i).counit ((leftAdjoint i).obj X)) =
i.map
((leftAdjoint i).map (NatTrans.app (ofRightAdjoint i).unit X) β«
NatTrans.app (ofRightAdjoint i).counit ((leftAdjoint i).obj X))
[PROOFSTEP]
simp
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
B : D
β’ IsIso (NatTrans.app (ofRightAdjoint i).unit (i.obj B))
[PROOFSTEP]
have : (ofRightAdjoint i).unit.app (i.obj B) = inv (i.map ((ofRightAdjoint i).counit.app B)) :=
by
rw [β comp_hom_eq_id]
apply (ofRightAdjoint i).right_triangle_components
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
B : D
β’ NatTrans.app (ofRightAdjoint i).unit (i.obj B) = inv (i.map (NatTrans.app (ofRightAdjoint i).counit B))
[PROOFSTEP]
rw [β comp_hom_eq_id]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
B : D
β’ NatTrans.app (ofRightAdjoint i).unit (i.obj B) β« i.map (NatTrans.app (ofRightAdjoint i).counit B) =
π ((π C).obj (i.obj B))
[PROOFSTEP]
apply (ofRightAdjoint i).right_triangle_components
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
B : D
this : NatTrans.app (ofRightAdjoint i).unit (i.obj B) = inv (i.map (NatTrans.app (ofRightAdjoint i).counit B))
β’ IsIso (NatTrans.app (ofRightAdjoint i).unit (i.obj B))
[PROOFSTEP]
rw [this]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
B : D
this : NatTrans.app (ofRightAdjoint i).unit (i.obj B) = inv (i.map (NatTrans.app (ofRightAdjoint i).counit B))
β’ IsIso (inv (i.map (NatTrans.app (ofRightAdjoint i).counit B)))
[PROOFSTEP]
exact IsIso.inv_isIso
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A : C
h : A β essImage i
β’ IsIso (NatTrans.app (ofRightAdjoint i).unit A)
[PROOFSTEP]
suffices
(ofRightAdjoint i).unit.app A =
h.getIso.inv β«
(ofRightAdjoint i).unit.app (i.obj (Functor.essImage.witness h)) β« (leftAdjoint i β i).map h.getIso.hom
by
rw [this]
infer_instance
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A : C
h : A β essImage i
this :
NatTrans.app (ofRightAdjoint i).unit A =
(getIso h).inv β« NatTrans.app (ofRightAdjoint i).unit (i.obj (witness h)) β« (leftAdjoint i β i).map (getIso h).hom
β’ IsIso (NatTrans.app (ofRightAdjoint i).unit A)
[PROOFSTEP]
rw [this]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A : C
h : A β essImage i
this :
NatTrans.app (ofRightAdjoint i).unit A =
(getIso h).inv β« NatTrans.app (ofRightAdjoint i).unit (i.obj (witness h)) β« (leftAdjoint i β i).map (getIso h).hom
β’ IsIso
((getIso h).inv β« NatTrans.app (ofRightAdjoint i).unit (i.obj (witness h)) β« (leftAdjoint i β i).map (getIso h).hom)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A : C
h : A β essImage i
β’ NatTrans.app (ofRightAdjoint i).unit A =
(getIso h).inv β« NatTrans.app (ofRightAdjoint i).unit (i.obj (witness h)) β« (leftAdjoint i β i).map (getIso h).hom
[PROOFSTEP]
rw [β NatTrans.naturality]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A : C
h : A β essImage i
β’ NatTrans.app (ofRightAdjoint i).unit A =
(getIso h).inv β« (π C).map (getIso h).hom β« NatTrans.app (ofRightAdjoint i).unit A
[PROOFSTEP]
simp
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
β’ A β Functor.essImage i
[PROOFSTEP]
let Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
β’ A β Functor.essImage i
[PROOFSTEP]
haveI : IsIso (Ξ·.app (i.obj ((leftAdjoint i).obj A))) := Functor.essImage.unit_isIso ((i.obj_mem_essImage _))
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
this : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
β’ A β Functor.essImage i
[PROOFSTEP]
have : Epi (Ξ·.app A) := by
refine @epi_of_epi _ _ _ _ _ (retraction (Ξ·.app A)) (Ξ·.app A) ?_
rw [show retraction _ β« Ξ·.app A = _ from Ξ·.naturality (retraction (Ξ·.app A))]
apply epi_comp (Ξ·.app (i.obj ((leftAdjoint i).obj A)))
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
this : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
β’ Epi (NatTrans.app Ξ· A)
[PROOFSTEP]
refine @epi_of_epi _ _ _ _ _ (retraction (Ξ·.app A)) (Ξ·.app A) ?_
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
this : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
β’ Epi (retraction (NatTrans.app Ξ· A) β« NatTrans.app Ξ· A)
[PROOFSTEP]
rw [show retraction _ β« Ξ·.app A = _ from Ξ·.naturality (retraction (Ξ·.app A))]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
this : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
β’ Epi (NatTrans.app Ξ· ((leftAdjoint i β i).obj A) β« (leftAdjoint i β i).map (retraction (NatTrans.app Ξ· A)))
[PROOFSTEP]
apply epi_comp (Ξ·.app (i.obj ((leftAdjoint i).obj A)))
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
thisβ : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
this : Epi (NatTrans.app Ξ· A)
β’ A β Functor.essImage i
[PROOFSTEP]
skip
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
thisβ : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
this : Epi (NatTrans.app Ξ· A)
β’ A β Functor.essImage i
[PROOFSTEP]
haveI := isIso_of_epi_of_isSplitMono (Ξ·.app A)
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instββ΄ : Category.{vβ, uβ} C
instβΒ³ : Category.{vβ, uβ} D
instβΒ² : Category.{vβ, uβ} E
i : D β₯€ C
instβΒΉ : Reflective i
A : C
instβ : IsSplitMono (NatTrans.app (ofRightAdjoint i).unit A)
Ξ· : π C βΆ leftAdjoint i β i := (ofRightAdjoint i).unit
thisβΒΉ : IsIso (NatTrans.app Ξ· (i.obj ((leftAdjoint i).obj A)))
thisβ : Epi (NatTrans.app Ξ· A)
this : IsIso (NatTrans.app Ξ· A)
β’ A β Functor.essImage i
[PROOFSTEP]
exact mem_essImage_of_unit_isIso A
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A : C
B : D
f : i.obj ((leftAdjoint i).obj A) βΆ i.obj B
β’ β(unitCompPartialBijectiveAux A B).symm f = NatTrans.app (ofRightAdjoint i).unit A β« f
[PROOFSTEP]
simp [unitCompPartialBijectiveAux]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A B : C
hB : B β Functor.essImage i
f : i.obj ((leftAdjoint i).obj A) βΆ B
β’ β(unitCompPartialBijective A hB).symm f = NatTrans.app (ofRightAdjoint i).unit A β« f
[PROOFSTEP]
simp [unitCompPartialBijective, unitCompPartialBijectiveAux_symm_apply]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A B B' : C
h : B βΆ B'
hB : B β Functor.essImage i
hB' : B' β Functor.essImage i
f : i.obj ((leftAdjoint i).obj A) βΆ B
β’ β(unitCompPartialBijective A hB').symm (f β« h) = β(unitCompPartialBijective A hB).symm f β« h
[PROOFSTEP]
simp
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
A B B' : C
h : B βΆ B'
hB : B β Functor.essImage i
hB' : B' β Functor.essImage i
f : A βΆ B
β’ β(unitCompPartialBijective A hB') (f β« h) = β(unitCompPartialBijective A hB) f β« h
[PROOFSTEP]
rw [β Equiv.eq_symm_apply, unitCompPartialBijective_symm_natural A h, Equiv.symm_apply_apply]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : Functor.EssImageSubcategory i
β’ ((Functor.essImageInclusion i β leftAdjoint i) β Functor.toEssImage i).obj X β
X
[PROOFSTEP]
refine' Iso.symm (@asIso _ _ X _ ((ofRightAdjoint i).unit.app X.obj) ?_)
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : Functor.EssImageSubcategory i
β’ IsIso (NatTrans.app (ofRightAdjoint i).unit X.obj)
[PROOFSTEP]
refine @isIso_of_reflects_iso _ _ _ _ _ _ _ i.essImageInclusion ?_ _
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : Functor.EssImageSubcategory i
β’ IsIso ((Functor.essImageInclusion i).map (NatTrans.app (ofRightAdjoint i).unit X.obj))
[PROOFSTEP]
dsimp
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : Functor.EssImageSubcategory i
β’ IsIso (NatTrans.app (ofRightAdjoint i).unit X.obj)
[PROOFSTEP]
exact inferInstance
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : Functor.EssImageSubcategory i
β’ (Functor.essImageInclusion i).map (equivEssImageOfReflective_counitIso_app X).hom =
inv (NatTrans.app (ofRightAdjoint i).unit X.obj)
[PROOFSTEP]
simp [equivEssImageOfReflective_counitIso_app, asIso]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : Functor.EssImageSubcategory i
β’ inv (NatTrans.app (ofRightAdjoint i).unit X.obj) = inv (NatTrans.app (ofRightAdjoint i).unit X.obj)
[PROOFSTEP]
rfl
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
β’ β {X Y : D} (f : X βΆ Y),
(π D).map f β« ((fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm) Y).hom =
((fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm) X).hom β«
(Functor.toEssImage i β Functor.essImageInclusion i β leftAdjoint i).map f
[PROOFSTEP]
intro X Y f
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : D
f : X βΆ Y
β’ (π D).map f β« ((fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm) Y).hom =
((fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm) X).hom β«
(Functor.toEssImage i β Functor.essImageInclusion i β leftAdjoint i).map f
[PROOFSTEP]
dsimp
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : D
f : X βΆ Y
β’ f β« inv (NatTrans.app (ofRightAdjoint i).counit Y) =
inv (NatTrans.app (ofRightAdjoint i).counit X) β« (leftAdjoint i).map (i.map f)
[PROOFSTEP]
rw [IsIso.comp_inv_eq, Category.assoc, IsIso.eq_inv_comp]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : D
f : X βΆ Y
β’ NatTrans.app (ofRightAdjoint i).counit X β« f =
(leftAdjoint i).map (i.map f) β« NatTrans.app (ofRightAdjoint i).counit Y
[PROOFSTEP]
exact ((ofRightAdjoint i).counit.naturality f).symm
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
β’ β {X Y : Functor.EssImageSubcategory i} (f : X βΆ Y),
((Functor.essImageInclusion i β leftAdjoint i) β Functor.toEssImage i).map f β«
(equivEssImageOfReflective_counitIso_app Y).hom =
(equivEssImageOfReflective_counitIso_app X).hom β« (π (Functor.EssImageSubcategory i)).map f
[PROOFSTEP]
intro X Y f
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : Functor.EssImageSubcategory i
f : X βΆ Y
β’ ((Functor.essImageInclusion i β leftAdjoint i) β Functor.toEssImage i).map f β«
(equivEssImageOfReflective_counitIso_app Y).hom =
(equivEssImageOfReflective_counitIso_app X).hom β« (π (Functor.EssImageSubcategory i)).map f
[PROOFSTEP]
apply (Functor.essImageInclusion i).map_injective
[GOAL]
case a
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : Functor.EssImageSubcategory i
f : X βΆ Y
β’ (Functor.essImageInclusion i).map
(((Functor.essImageInclusion i β leftAdjoint i) β Functor.toEssImage i).map f β«
(equivEssImageOfReflective_counitIso_app Y).hom) =
(Functor.essImageInclusion i).map
((equivEssImageOfReflective_counitIso_app X).hom β« (π (Functor.EssImageSubcategory i)).map f)
[PROOFSTEP]
have h := ((ofRightAdjoint i).unit.naturality f).symm
[GOAL]
case a
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : Functor.EssImageSubcategory i
f : X βΆ Y
h :
NatTrans.app (ofRightAdjoint i).unit X.obj β« (leftAdjoint i β i).map f =
(π C).map f β« NatTrans.app (ofRightAdjoint i).unit Y.obj
β’ (Functor.essImageInclusion i).map
(((Functor.essImageInclusion i β leftAdjoint i) β Functor.toEssImage i).map f β«
(equivEssImageOfReflective_counitIso_app Y).hom) =
(Functor.essImageInclusion i).map
((equivEssImageOfReflective_counitIso_app X).hom β« (π (Functor.EssImageSubcategory i)).map f)
[PROOFSTEP]
rw [Functor.id_map] at h
[GOAL]
case a
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X Y : Functor.EssImageSubcategory i
f : X βΆ Y
h :
NatTrans.app (ofRightAdjoint i).unit X.obj β« (leftAdjoint i β i).map f =
f β« NatTrans.app (ofRightAdjoint i).unit Y.obj
β’ (Functor.essImageInclusion i).map
(((Functor.essImageInclusion i β leftAdjoint i) β Functor.toEssImage i).map f β«
(equivEssImageOfReflective_counitIso_app Y).hom) =
(Functor.essImageInclusion i).map
((equivEssImageOfReflective_counitIso_app X).hom β« (π (Functor.EssImageSubcategory i)).map f)
[PROOFSTEP]
erw [Functor.map_comp, Functor.map_comp, equivEssImageOfReflective_map_counitIso_app_hom,
equivEssImageOfReflective_map_counitIso_app_hom, IsIso.comp_inv_eq, assoc, β h, IsIso.inv_hom_id_assoc,
Functor.comp_map]
[GOAL]
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : D
β’ (Functor.toEssImage i).map
(NatTrans.app (NatIso.ofComponents fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm).hom X) β«
NatTrans.app (NatIso.ofComponents equivEssImageOfReflective_counitIso_app).hom ((Functor.toEssImage i).obj X) =
π ((Functor.toEssImage i).obj X)
[PROOFSTEP]
apply (Functor.essImageInclusion i).map_injective
[GOAL]
case a
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : D
β’ (Functor.essImageInclusion i).map
((Functor.toEssImage i).map
(NatTrans.app (NatIso.ofComponents fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm).hom X) β«
NatTrans.app (NatIso.ofComponents equivEssImageOfReflective_counitIso_app).hom ((Functor.toEssImage i).obj X)) =
(Functor.essImageInclusion i).map (π ((Functor.toEssImage i).obj X))
[PROOFSTEP]
erw [Functor.map_comp, equivEssImageOfReflective_map_counitIso_app_hom]
[GOAL]
case a
C : Type uβ
D : Type uβ
E : Type uβ
instβΒ³ : Category.{vβ, uβ} C
instβΒ² : Category.{vβ, uβ} D
instβΒΉ : Category.{vβ, uβ} E
i : D β₯€ C
instβ : Reflective i
X : D
β’ (Functor.essImageInclusion i).map
((Functor.toEssImage i).map
(NatTrans.app (NatIso.ofComponents fun X => (asIso (NatTrans.app (ofRightAdjoint i).counit X)).symm).hom X)) β«
inv
(NatTrans.app (ofRightAdjoint i).unit
((π (Functor.EssImageSubcategory i)).obj ((Functor.toEssImage i).obj X)).obj) =
(Functor.essImageInclusion i).map (π ((Functor.toEssImage i).obj X))
[PROOFSTEP]
aesop_cat
|
State Before: ΞΉ : Type u_1
M : Type ?u.49727
n : β
I J : Box ΞΉ
i : ΞΉ
x : β
instβ : Finite ΞΉ
s : Finset (Box ΞΉ)
β’ βαΆ (t : Finset (ΞΉ Γ β)) in atTop,
β (I J : Box ΞΉ), J β s β β (J' : Box ΞΉ), J' β splitMany I t β Β¬Disjoint βJ βJ' β J' β€ J State After: case intro
ΞΉ : Type u_1
M : Type ?u.49727
n : β
I J : Box ΞΉ
i : ΞΉ
x : β
instβ : Finite ΞΉ
s : Finset (Box ΞΉ)
valβ : Fintype ΞΉ
β’ βαΆ (t : Finset (ΞΉ Γ β)) in atTop,
β (I J : Box ΞΉ), J β s β β (J' : Box ΞΉ), J' β splitMany I t β Β¬Disjoint βJ βJ' β J' β€ J Tactic: cases nonempty_fintype ΞΉ State Before: case intro
ΞΉ : Type u_1
M : Type ?u.49727
n : β
I J : Box ΞΉ
i : ΞΉ
x : β
instβ : Finite ΞΉ
s : Finset (Box ΞΉ)
valβ : Fintype ΞΉ
β’ βαΆ (t : Finset (ΞΉ Γ β)) in atTop,
β (I J : Box ΞΉ), J β s β β (J' : Box ΞΉ), J' β splitMany I t β Β¬Disjoint βJ βJ' β J' β€ J State After: case intro
ΞΉ : Type u_1
M : Type ?u.49727
n : β
Iβ Jβ : Box ΞΉ
iβ : ΞΉ
x : β
instβ : Finite ΞΉ
s : Finset (Box ΞΉ)
valβ : Fintype ΞΉ
t : Finset (ΞΉ Γ β)
ht : t β₯ Finset.biUnion s fun J => Finset.biUnion Finset.univ fun i => {(i, Box.lower J i), (i, Box.upper J i)}
I J : Box ΞΉ
hJ : J β s
J' : Box ΞΉ
hJ' : J' β splitMany I t
i : ΞΉ
β’ {(i, Box.lower J i), (i, Box.upper J i)} β t Tactic: refine' eventually_atTop.2
β¨s.biUnion fun J => Finset.univ.biUnion fun i => {(i, J.lower i), (i, J.upper i)},
fun t ht I J hJ J' hJ' => not_disjoint_imp_le_of_subset_of_mem_splitMany (fun i => _) hJ'β© State Before: case intro
ΞΉ : Type u_1
M : Type ?u.49727
n : β
Iβ Jβ : Box ΞΉ
iβ : ΞΉ
x : β
instβ : Finite ΞΉ
s : Finset (Box ΞΉ)
valβ : Fintype ΞΉ
t : Finset (ΞΉ Γ β)
ht : t β₯ Finset.biUnion s fun J => Finset.biUnion Finset.univ fun i => {(i, Box.lower J i), (i, Box.upper J i)}
I J : Box ΞΉ
hJ : J β s
J' : Box ΞΉ
hJ' : J' β splitMany I t
i : ΞΉ
β’ {(i, Box.lower J i), (i, Box.upper J i)} β t State After: no goals Tactic: exact fun p hp =>
ht (Finset.mem_biUnion.2 β¨J, hJ, Finset.mem_biUnion.2 β¨i, Finset.mem_univ _, hpβ©β©) |
lemma Sup_lexord1: assumes A: "A \<noteq> {}" "(\<And>a. a \<in> A \<Longrightarrow> k a = (\<Union>a\<in>A. k a))" "P (c A)" shows "P (Sup_lexord k c s A)" |
lemma analytic_on_mult [analytic_intros]: assumes f: "f analytic_on S" and g: "g analytic_on S" shows "(\<lambda>z. f z * g z) analytic_on S" |
# This file was generated, do not modify it. # hide
rms(y_wind[test], y_hat) |
function get_realization(n::Integer, prep_fn = "prep.h5")
habitat = load_realization(prep_fn, "habitat", n)
movement = load_movement(prep_fn, "movement", n)
init_pop = load_spatial_eq(prep_fn, "spatial_eq", n)
comm_catchability = load_realization(prep_fn, "catchability_devs", n)
log_qdevs = load_realization(prep_fn, "log_catchability_devs", n)
habitat, movement, init_pop, comm_catchability, log_qdevs
end
struct SpatQSimPrep{M, P, Q, F}
realization::Int
movement::M
init_pop::P
log_qdevs::Q
prep_file::F
function SpatQSimPrep(realization::Int,
movement::M,
init_pop::P,
log_qdevs::Q,
prep_file::F = nothing) where {M<:MovementModel,
P<:PopState,
Q<:Matrix,
F<:Union{String, Nothing}}
new{M, P, Q, F}(realization, movement, init_pop, log_qdevs, prep_file)
end
end
function SpatQSimPrep(realization::Int, prep_file::String)
_, movement, init_pop, _, log_qdevs =
get_realization(realization, prep_file)
SpatQSimPrep(realization, movement, init_pop, log_qdevs, prep_file)
end
movement(prep::SpatQSimPrep) = prep.movement
init_pop(prep::SpatQSimPrep) = prep.init_pop
log_qdevs(prep::SpatQSimPrep) = prep.log_qdevs
realization(prep::SpatQSimPrep) = prep.realization
prep_file(prep::SpatQSimPrep) = prep.prep_file
|
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ IsReflexivePair (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
[PROOFSTEP]
apply IsReflexivePair.mk' _ _ _
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ (free T).obj X.A βΆ (free T).obj (T.obj X.A)
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ ?m.2463 β« FreeCoequalizer.topMap X = π ((free T).obj X.A)
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ ?m.2463 β« FreeCoequalizer.bottomMap X = π ((free T).obj X.A)
[PROOFSTEP]
apply (free T).map (T.Ξ·.app X.A)
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ (free T).map (NatTrans.app (Ξ· T) X.A) β« FreeCoequalizer.topMap X = π ((free T).obj X.A)
[PROOFSTEP]
ext
[GOAL]
case h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ ((free T).map (NatTrans.app (Ξ· T) X.A) β« FreeCoequalizer.topMap X).f = (π ((free T).obj X.A)).f
[PROOFSTEP]
dsimp
[GOAL]
case h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ T.map (NatTrans.app (Ξ· T) X.A) β« T.map X.a = π (T.obj X.A)
[PROOFSTEP]
rw [β Functor.map_comp, X.unit, Functor.map_id]
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ (free T).map (NatTrans.app (Ξ· T) X.A) β« FreeCoequalizer.bottomMap X = π ((free T).obj X.A)
[PROOFSTEP]
ext
[GOAL]
case h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
β’ ((free T).map (NatTrans.app (Ξ· T) X.A) β« FreeCoequalizer.bottomMap X).f = (π ((free T).obj X.A)).f
[PROOFSTEP]
apply Monad.right_unit
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
β’ { l //
Cofork.Ο (beckAlgebraCofork X) β« l = Cofork.Ο s β§
β
{m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one},
Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s β m = l }
[PROOFSTEP]
have hβ : (T : C β₯€ C).map X.a β« s.Ο.f = T.ΞΌ.app X.A β« s.Ο.f := congr_arg Monad.Algebra.Hom.f s.condition
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ { l //
Cofork.Ο (beckAlgebraCofork X) β« l = Cofork.Ο s β§
β
{m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one},
Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s β m = l }
[PROOFSTEP]
have hβ : (T : C β₯€ C).map s.Ο.f β« s.pt.a = T.ΞΌ.app X.A β« s.Ο.f := s.Ο.h
[GOAL]
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ { l //
Cofork.Ο (beckAlgebraCofork X) β« l = Cofork.Ο s β§
β
{m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one},
Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s β m = l }
[PROOFSTEP]
refine' β¨β¨T.Ξ·.app _ β« s.Ο.f, _β©, _, _β©
[GOAL]
case refine'_1
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ T.map (NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f) β« s.pt.a =
(beckAlgebraCofork X).pt.a β« NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f
[PROOFSTEP]
dsimp
[GOAL]
case refine'_1
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ T.map (NatTrans.app (Ξ· T) X.1 β« (Cofork.Ο s).f) β« s.pt.a = X.a β« NatTrans.app (Ξ· T) X.1 β« (Cofork.Ο s).f
[PROOFSTEP]
rw [Functor.map_comp, Category.assoc, hβ, Monad.right_unit_assoc, show X.a β« _ β« _ = _ from T.Ξ·.naturality_assoc _ _,
hβ, Monad.left_unit_assoc]
[GOAL]
case refine'_2
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ Cofork.Ο (beckAlgebraCofork X) β« Algebra.Hom.mk (NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f) =
Cofork.Ο s
[PROOFSTEP]
ext
[GOAL]
case refine'_2.h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ (Cofork.Ο (beckAlgebraCofork X) β« Algebra.Hom.mk (NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f)).f =
(Cofork.Ο s).f
[PROOFSTEP]
simpa [β T.Ξ·.naturality_assoc, T.left_unit_assoc] using T.Ξ·.app ((T : C β₯€ C).obj X.A) β«= hβ
[GOAL]
case refine'_3
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
β’ β
{m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one},
Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s β
m = Algebra.Hom.mk (NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f)
[PROOFSTEP]
intro m hm
[GOAL]
case refine'_3
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one
hm : Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s
β’ m = Algebra.Hom.mk (NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f)
[PROOFSTEP]
ext
[GOAL]
case refine'_3.h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one
hm : Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s
β’ m.f = (Algebra.Hom.mk (NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f)).f
[PROOFSTEP]
dsimp only
[GOAL]
case refine'_3.h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one
hm : Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s
β’ m.f = NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο s).f
[PROOFSTEP]
rw [β hm]
[GOAL]
case refine'_3.h
C : Type uβ
instβ : Category.{vβ, uβ} C
T : Monad C
X : Algebra T
s : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)
hβ : T.map X.a β« (Cofork.Ο s).f = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
hβ : T.map (Cofork.Ο s).f β« s.pt.a = NatTrans.app (ΞΌ T) X.A β« (Cofork.Ο s).f
m :
((Functor.const WalkingParallelPair).obj (beckAlgebraCofork X).pt).obj WalkingParallelPair.one βΆ
((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one
hm : Cofork.Ο (beckAlgebraCofork X) β« m = Cofork.Ο s
β’ m.f = NatTrans.app (Ξ· T) (beckAlgebraCofork X).pt.1 β« (Cofork.Ο (beckAlgebraCofork X) β« m).f
[PROOFSTEP]
apply (X.unit_assoc _).symm
|
/-
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle SΓΆnne, Benjamin Davidson
! This file was ported from Lean 3 source module analysis.special_functions.complex.log_deriv
! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Analysis.SpecialFunctions.Complex.Log
import Mathbin.Analysis.SpecialFunctions.ExpDeriv
/-!
# Differentiability of the complex `log` function
-/
noncomputable section
namespace Complex
open Set Filter
open Real Topology
/-- `complex.exp` as a `local_homeomorph` with `source = {z | -Ο < im z < Ο}` and
`target = {z | 0 < re z} βͺ {z | im z β 0}`. This definition is used to prove that `complex.log`
is complex differentiable at all points but the negative real semi-axis. -/
def expLocalHomeomorph : LocalHomeomorph β β :=
LocalHomeomorph.ofContinuousOpen
{ toFun := exp
invFun := log
source := { z : β | z.im β Ioo (-Ο) Ο }
target := { z : β | 0 < z.re } βͺ { z : β | z.im β 0 }
map_source' := by
rintro β¨x, yβ© β¨hβ : -Ο < y, hβ : y < Οβ©
refine' (not_or_of_imp fun hz => _).symm
obtain rfl : y = 0 := by
rw [exp_im] at hz
simpa [(Real.exp_pos _).ne', Real.sin_eq_zero_iff_of_lt_of_lt hβ hβ] using hz
rw [mem_set_of_eq, β of_real_def, exp_of_real_re]
exact Real.exp_pos x
map_target' := fun z h =>
suffices 0 β€ z.re β¨ z.im β 0 by
simpa [log_im, neg_pi_lt_arg, (arg_le_pi _).lt_iff_ne, arg_eq_pi_iff, not_and_or]
h.imp (fun h => le_of_lt h) id
left_inv' := fun x hx => log_exp hx.1 (le_of_lt hx.2)
right_inv' := fun x hx =>
exp_log <| by
rintro rfl
simpa [lt_irrefl] using hx }
continuous_exp.ContinuousOn isOpenMap_exp (isOpen_Ioo.Preimage continuous_im)
#align complex.exp_local_homeomorph Complex.expLocalHomeomorph
theorem hasStrictDerivAt_log {x : β} (h : 0 < x.re β¨ x.im β 0) : HasStrictDerivAt log xβ»ΒΉ x :=
have h0 : x β 0 := by
rintro rfl
simpa [lt_irrefl] using h
expLocalHomeomorph.hasStrictDerivAt_symm h h0 <| by
simpa [exp_log h0] using has_strict_deriv_at_exp (log x)
#align complex.has_strict_deriv_at_log Complex.hasStrictDerivAt_log
theorem hasStrictFderivAt_log_real {x : β} (h : 0 < x.re β¨ x.im β 0) :
HasStrictFderivAt log (xβ»ΒΉ β’ (1 : β βL[β] β)) x :=
(hasStrictDerivAt_log h).complexToReal_fderiv
#align complex.has_strict_fderiv_at_log_real Complex.hasStrictFderivAt_log_real
theorem contDiffAt_log {x : β} (h : 0 < x.re β¨ x.im β 0) {n : ββ} : ContDiffAt β n log x :=
expLocalHomeomorph.contDiffAt_symm_deriv (exp_ne_zero <| log x) h (hasDerivAt_exp _)
contDiff_exp.ContDiffAt
#align complex.cont_diff_at_log Complex.contDiffAt_log
end Complex
section LogDeriv
open Complex Filter
open Topology
variable {Ξ± : Type _} [TopologicalSpace Ξ±] {E : Type _} [NormedAddCommGroup E] [NormedSpace β E]
theorem HasStrictFderivAt.clog {f : E β β} {f' : E βL[β] β} {x : E} (hβ : HasStrictFderivAt f f' x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasStrictFderivAt (fun t => log (f t)) ((f x)β»ΒΉ β’ f') x :=
(hasStrictDerivAt_log hβ).comp_hasStrictFderivAt x hβ
#align has_strict_fderiv_at.clog HasStrictFderivAt.clog
theorem HasStrictDerivAt.clog {f : β β β} {f' x : β} (hβ : HasStrictDerivAt f f' x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasStrictDerivAt (fun t => log (f t)) (f' / f x) x :=
by
rw [div_eq_inv_mul]
exact (has_strict_deriv_at_log hβ).comp x hβ
#align has_strict_deriv_at.clog HasStrictDerivAt.clog
theorem HasStrictDerivAt.clog_real {f : β β β} {x : β} {f' : β} (hβ : HasStrictDerivAt f f' x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasStrictDerivAt (fun t => log (f t)) (f' / f x) x := by
simpa only [div_eq_inv_mul] using (has_strict_fderiv_at_log_real hβ).comp_hasStrictDerivAt x hβ
#align has_strict_deriv_at.clog_real HasStrictDerivAt.clog_real
theorem HasFderivAt.clog {f : E β β} {f' : E βL[β] β} {x : E} (hβ : HasFderivAt f f' x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasFderivAt (fun t => log (f t)) ((f x)β»ΒΉ β’ f') x :=
(hasStrictDerivAt_log hβ).HasDerivAt.comp_hasFderivAt x hβ
#align has_fderiv_at.clog HasFderivAt.clog
theorem HasDerivAt.clog {f : β β β} {f' x : β} (hβ : HasDerivAt f f' x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasDerivAt (fun t => log (f t)) (f' / f x) x :=
by
rw [div_eq_inv_mul]
exact (has_strict_deriv_at_log hβ).HasDerivAt.comp x hβ
#align has_deriv_at.clog HasDerivAt.clog
theorem HasDerivAt.clog_real {f : β β β} {x : β} {f' : β} (hβ : HasDerivAt f f' x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasDerivAt (fun t => log (f t)) (f' / f x) x := by
simpa only [div_eq_inv_mul] using
(has_strict_fderiv_at_log_real hβ).HasFderivAt.comp_hasDerivAt x hβ
#align has_deriv_at.clog_real HasDerivAt.clog_real
theorem DifferentiableAt.clog {f : E β β} {x : E} (hβ : DifferentiableAt β f x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : DifferentiableAt β (fun t => log (f t)) x :=
(hβ.HasFderivAt.clog hβ).DifferentiableAt
#align differentiable_at.clog DifferentiableAt.clog
theorem HasFderivWithinAt.clog {f : E β β} {f' : E βL[β] β} {s : Set E} {x : E}
(hβ : HasFderivWithinAt f f' s x) (hβ : 0 < (f x).re β¨ (f x).im β 0) :
HasFderivWithinAt (fun t => log (f t)) ((f x)β»ΒΉ β’ f') s x :=
(hasStrictDerivAt_log hβ).HasDerivAt.comp_hasFderivWithinAt x hβ
#align has_fderiv_within_at.clog HasFderivWithinAt.clog
theorem HasDerivWithinAt.clog {f : β β β} {f' x : β} {s : Set β} (hβ : HasDerivWithinAt f f' s x)
(hβ : 0 < (f x).re β¨ (f x).im β 0) : HasDerivWithinAt (fun t => log (f t)) (f' / f x) s x :=
by
rw [div_eq_inv_mul]
exact (has_strict_deriv_at_log hβ).HasDerivAt.comp_hasDerivWithinAt x hβ
#align has_deriv_within_at.clog HasDerivWithinAt.clog
theorem HasDerivWithinAt.clog_real {f : β β β} {s : Set β} {x : β} {f' : β}
(hβ : HasDerivWithinAt f f' s x) (hβ : 0 < (f x).re β¨ (f x).im β 0) :
HasDerivWithinAt (fun t => log (f t)) (f' / f x) s x := by
simpa only [div_eq_inv_mul] using
(has_strict_fderiv_at_log_real hβ).HasFderivAt.comp_hasDerivWithinAt x hβ
#align has_deriv_within_at.clog_real HasDerivWithinAt.clog_real
theorem DifferentiableWithinAt.clog {f : E β β} {s : Set E} {x : E}
(hβ : DifferentiableWithinAt β f s x) (hβ : 0 < (f x).re β¨ (f x).im β 0) :
DifferentiableWithinAt β (fun t => log (f t)) s x :=
(hβ.HasFderivWithinAt.clog hβ).DifferentiableWithinAt
#align differentiable_within_at.clog DifferentiableWithinAt.clog
theorem DifferentiableOn.clog {f : E β β} {s : Set E} (hβ : DifferentiableOn β f s)
(hβ : β x β s, 0 < (f x).re β¨ (f x).im β 0) : DifferentiableOn β (fun t => log (f t)) s :=
fun x hx => (hβ x hx).clog (hβ x hx)
#align differentiable_on.clog DifferentiableOn.clog
theorem Differentiable.clog {f : E β β} (hβ : Differentiable β f)
(hβ : β x, 0 < (f x).re β¨ (f x).im β 0) : Differentiable β fun t => log (f t) := fun x =>
(hβ x).clog (hβ x)
#align differentiable.clog Differentiable.clog
end LogDeriv
|
The public debate on which media can be trusted further divided the public and the focus on finding the truth became more contentious. This was on show at the White House Correspondents dinner, boycotted by Trump and nativist Breitbart and its key strategists now within the White House. Media self-examination predominated the dinner, of Fox, CNN, MSNBC and the traditional mainstream media, The Washington Post, New York Times, the New Yorker, The Atlantic and others. Meanwhile Trump created a media show by pitting his Pennsylvania rally in the same time slot, and lampooning the Washington event as βthe elitist fake news mediaβ. The Washington speakers fell into Trumpβs trap by proclaiming that they were not βfake newsβ β¦a fundamental communications error which gave more legitimacy to these slurs. |
module PatternSynonymOverloaded where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
pattern ss x = suc (suc x)
pattern ss x = suc x
|
SUBROUTINE ZPOSV_F95( A, B, UPLO, INFO )
!
! -- LAPACK95 interface driver routine (version 3.0) --
! UNI-C, Denmark; Univ. of Tennessee, USA; NAG Ltd., UK
! September, 2000
!
! .. USE STATEMENTS ..
USE LA_PRECISION, ONLY: WP => DP
USE LA_AUXMOD, ONLY: ERINFO, LSAME
USE F77_LAPACK, ONLY: POSV_F77 => LA_POSV
! .. IMPLICIT STATEMENT ..
IMPLICIT NONE
! .. SCALAR ARGUMENTS ..
CHARACTER(LEN=1), INTENT(IN), OPTIONAL :: UPLO
INTEGER, INTENT(OUT), OPTIONAL :: INFO
! .. ARRAY ARGUMENTS ..
COMPLEX(WP), INTENT(INOUT) :: A(:,:), B(:,:)
!----------------------------------------------------------------------
!
! Purpose
! =======
!
! LA_POSV computes the solution to a linear system of equations
! A*X=B, where A is real symmetric or complex Hermitian and, in either
! case, positive definite, and where X and B are rectangular matrices
! or vectors. The Cholesky decomposition is used to factor A as
! A = U^H*U if UPLO = 'U', or A = L*L^H if UPLO = 'L'
! where U is an upper triangular matrix and L is a lower triangular
! matrix (L = U^H ). The factored form of A is then used to solve the
! above system.
!
! =========
!
! SUBROUTINE LA_POSV( A, B, UPLO=uplo, INFO=info )
! <type>(<wp>), INTENT(INOUT) :: A(:,:), <rhs>
! CHARACTER(LEN=1), INTENT(IN), OPTIONAL :: UPLO
! INTEGER, INTENT(OUT), OPTIONAL :: INFO
! where
! <type> ::= REAL | COMPLEX
! <wp> ::= KIND(1.0) | KIND(1.0D0)
! <rhs> ::= B(:,:) | B(:)
!
! Arguments
! =========
!
! A (input/output) REAL or COMPLEX square array, shape (:,:).
! On entry, the matrix A.
! If UPLO = 'U', the upper triangular part of A contains the upper
! triangular part of the matrix A, and the strictly lower triangular
! part of A is not referenced. If UPLO = 'L', the lower triangular
! part of A contains the lower triangular part of the matrix A, and
! the strictly upper triangular part of A is not referenced.
! On exit, the factor U or L from the Cholesky factorization
! A = U^H*U = L*L^H.
! B (input/output) REAL or COMPLEX array, shape (:,:) with
! size(B,1) = size(A,1) or shape (:) with size(B) = size(A,1).
! On entry, the matrix B.
! On exit, the solution matrix X.
! UPLO Optional (input) CHARACTER(LEN=1)
! = 'U': Upper triangle of A is stored;
! = 'L': Lower triangle of A is stored.
! Default value: 'U'.
! INFO Optional (output) INTEGER
! = 0: sauccessful exit.
! < 0: if INFO = -i, the i-th argument had an illegal value.
! > 0: if INFO = i, the leading minor of order i of A is not
! positive definite, so the factorization could not be
! completed and the solution could not be computed.
! If INFO is not present and an error occurs, then the program is
! terminated with an error message.
!----------------------------------------------------------------------
! .. PARAMETERS ..
CHARACTER(LEN=7), PARAMETER :: SRNAME = 'LA_POSV'
! .. LOCAL SCALARS ..
CHARACTER(LEN=1) :: LUPLO
INTEGER :: LINFO, N, NRHS
! .. INTRINSIC FUNCTIONS ..
INTRINSIC SIZE, PRESENT
! .. EXECUTABLE STATEMENTS ..
LINFO = 0; N = SIZE(A,1); NRHS = SIZE(B,2)
IF( PRESENT(UPLO) )THEN; LUPLO = UPLO; ELSE; LUPLO = 'U'; END IF
! .. TEST THE ARGUMENTS
IF( SIZE( A, 2 ) /= N .OR. N < 0 ) THEN; LINFO = -1
ELSE IF( SIZE( B, 1 ) /= N .OR. NRHS < 0 ) THEN; LINFO = -2
ELSE IF( .NOT.LSAME(LUPLO,'U') .AND. .NOT.LSAME(LUPLO,'L') )THEN; LINFO = -3
ELSE IF ( N > 0 ) THEN
CALL POSV_F77( LUPLO, N, NRHS, A, N, B, N, LINFO )
END IF
CALL ERINFO( LINFO, SRNAME, INFO )
END SUBROUTINE ZPOSV_F95
|
module m
implicit none
contains
pure integer function twice(i)
integer, intent(in) :: i
twice = 2*i ! result has same name as function
end function twice
!
pure function double(i) result(j)
integer, intent(in) :: i
integer :: j
j = 2*i ! result has different name from function
end function double
!
pure function double_vec(i) result(j)
integer, intent(in) :: i(:)
integer :: j(size(i))
j = 2*i
end function double_vec
!
end module m
!
program test_func
use m, only: twice, double, double_vec
implicit none
print*,twice(3),double(3) ! 6 6
print*,double_vec([3,4]) ! 6 8
end program test_func
|
module Data.Collection.Core.Properties where
-- open import Data.List public using (List; []; _β·_)
-- open import Data.String public using (String; _β_)
-- open import Level using (zero)
--
-- open import Function using (flip)
-- open import Relation.Nullary
-- open import Relation.Nullary.Negation
-- open import Relation.Nullary.Decidable renaming (map to mapDec; mapβ² to mapDecβ²)
-- open import Relation.Unary
-- open import Relation.Binary
-- open import Relation.Binary.PropositionalEquality
|
(* Title: HOL/TPTP/TPTP_Proof_Reconstruction_Test.thy
Author: Nik Sultana, Cambridge University Computer Laboratory
Various tests for the proof reconstruction module.
NOTE
- looks for THF proofs in the path indicated by $THF_PROOFS
- these proofs are generated using LEO-II with the following
configuration choices: -po 1 -nux -nuc --expand_extuni
You can simply filter LEO-II's output using the filter_proof
script which is distributed with LEO-II.
*)
theory TPTP_Proof_Reconstruction_Test
imports TPTP_Test TPTP_Proof_Reconstruction
begin
section "Main function"
text "This function wraps all the reconstruction-related functions. Simply
point it at a THF proof produced by LEO-II (using the configuration described
above), and it will try to reconstruct it into an Isabelle/HOL theorem.
It also returns the theory (into which the axioms and definitions used in the
proof have been imported), but note that you can get the theory value from
the theorem value."
ML \<open>
reconstruct_leo2 (Path.explode "$THF_PROOFS/NUM667^1.p.out") @{theory}
\<close>
section "Prep for testing the component functions"
declare [[
tptp_trace_reconstruction = false,
tptp_test_all = false,
(* tptp_test_all = true, *)
tptp_test_timeout = 30,
(* tptp_max_term_size = 200 *)
tptp_max_term_size = 0
]]
declare [[ML_exception_trace, ML_print_depth = 200]]
section "Importing proofs"
ML \<open>
val probs =
(* "$THF_PROOFS/SYN991^1.p.out" *) (*lacks conjecture*)
(* "$THF_PROOFS/SYO040^2.p.out" *)
(* "$THF_PROOFS/NUM640^1.p.out" *)
(* "$THF_PROOFS/SEU553^2.p.out" *)
(* "$THF_PROOFS/NUM665^1.p.out" *)
(* "$THF_PROOFS/SEV161^5.p.out" *)
(* "$THF_PROOFS/SET014^4.p.out" *)
"$THF_PROOFS/NUM667^1.p.out"
|> Path.explode
|> single
val prob_names =
probs
|> map (Path.file_name #> TPTP_Problem_Name.Nonstandard)
\<close>
setup \<open>
if test_all @{context} then I
else
fold
(fn path =>
TPTP_Reconstruct.import_thm true [Path.dir path, Path.explode "$THF_PROOFS"] path leo2_on_load)
probs
\<close>
text "Display nicely."
ML \<open>
fun display_nicely ctxt (fms : TPTP_Reconstruct.formula_meaning list) =
List.app (fn ((n, data) : TPTP_Reconstruct.formula_meaning) =>
Pretty.writeln
(Pretty.block
[Pretty.str (n ^ " "),
Syntax.pretty_term ctxt (#fmla data),
Pretty.str (
if is_none (#source_inf_opt data) then ""
else ("\n\tannotation: " ^
@{make_string} (the (#source_inf_opt data : TPTP_Proof.source_info option))))])
) (rev fms);
(*FIXME hack for testing*)
fun test_fmla thy =
TPTP_Reconstruct.get_fmlas_of_prob thy (hd prob_names);
fun test_pannot thy =
TPTP_Reconstruct.get_pannot_of_prob thy (hd prob_names);
if test_all @{context} orelse prob_names = [] then ()
else
display_nicely @{context}
(#meta (test_pannot @{theory}))
(* To look at the original proof (i.e., before the proof transformations applied
when the proof is loaded) replace previous line with:
(test_fmla @{theory}
|> map TPTP_Reconstruct.structure_fmla_meaning)
*)
\<close>
ML \<open>
fun step_range_tester f_x f_exn ctxt prob_name from until =
let
val max =
case until of
SOME x => x
| NONE =>
if is_some Int.maxInt then the Int.maxInt else 999999
fun test_step x =
if x > max then ()
else
(f_x x;
(interpret_leo2_inference ctxt prob_name (Int.toString x); ())
handle e => f_exn e; (*FIXME naive. should let Interrupt through*)
(*assumes that inferences are numbered consecutively*)
test_step (x + 1))
in
test_step from
end
val step_range_tester_tracing =
step_range_tester
(fn x => tracing ("@step " ^ Int.toString x))
(fn e => tracing ("!!" ^ @{make_string} e))
\<close>
ML \<open>
(*try to reconstruct each inference step*)
if test_all @{context} orelse prob_names = []
orelse true (*NOTE currently disabled*)
then ()
else
let
(*FIXME not guaranteed to be the right nodes*)
val heur_start = 3
val heur_end =
hd (#meta (test_pannot @{theory}))
|> #1
|> Int.fromString
in
step_range_tester_tracing @{context} (hd prob_names) heur_start heur_end
end
\<close>
section "Building metadata and tactics"
subsection "Building the skeleton"
ML \<open>
if test_all @{context} orelse prob_names = [] then []
else TPTP_Reconstruct.make_skeleton @{context} (test_pannot @{theory});
length it
\<close>
subsection "The 'one shot' tactic approach"
ML \<open>
val the_tactic =
if test_all @{context} then []
else
map (fn prob_name =>
(TPTP_Reconstruct.naive_reconstruct_tac @{context} interpret_leo2_inference (* auto_based_reconstruction_tac *) (* oracle_based_reconstruction_tac *) prob_name))
prob_names;
\<close>
subsection "The 'piecemeal' approach"
ML \<open>
val the_tactics =
if test_all @{context} then []
else
map (fn prob_name =>
TPTP_Reconstruct.naive_reconstruct_tacs interpret_leo2_inference (* auto_based_reconstruction_tac *) (* oracle_based_reconstruction_tac *) prob_name @{context})
prob_names;
\<close>
declare [[ML_print_depth = 2000]]
ML \<open>
the_tactics
|> map (filter (fn (_, _, x) => is_none x)
#> map (fn (x, SOME y, _) => (x, cterm_of @{theory} y)))
\<close>
section "Using metadata and tactics"
text "There are various ways of testing the two ways (whole tactics or lists of tactics) of representing 'reconstructors'."
subsection "The 'one shot' tactic approach"
text "First we test whole tactics."
ML \<open>
(*produce thm*)
if test_all @{context} then []
else
map (
(* try *) (TPTP_Reconstruct.reconstruct @{context}
(fn prob_name =>
TPTP_Reconstruct.naive_reconstruct_tac @{context} interpret_leo2_inference prob_name
(* oracle_based_reconstruction_tac *))))
prob_names
\<close>
subsection "The 'piecemeal' approach"
ML \<open>
fun attac n = List.nth (List.nth (the_tactics, 0), n) |> #3 |> the |> snd
fun attac_to n 0 = attac n
| attac_to n m = attac n THEN attac_to (n + 1) (m - 1)
fun shotac n = List.nth (List.nth (the_tactics, 0), n) |> #3 |> the |> fst
\<close>
ML \<open>
(*Given a list of reconstructed inferences (as in "the_tactics" above,
count the number of failures and successes, and list the failed inference
reconstructions.*)
fun evaluate_the_tactics [] acc = acc
| evaluate_the_tactics ((node_no, (inf_name, inf_fmla, NONE)) :: xs) ((fai, suc), inf_list) =
let
val score = (fai + 1, suc)
val index_info = get_index (fn (x, _) => if x = node_no then SOME true else NONE) inf_list
val inf_list' =
case index_info of
NONE => (node_no, (inf_name, inf_fmla, 1)) :: inf_list
| SOME (idx, _) =>
nth_map idx (fn (node_no, (inf_name, inf_fmla, count)) => (node_no, (inf_name, inf_fmla, count + 1))) inf_list
in
evaluate_the_tactics xs (score, inf_list')
end
| evaluate_the_tactics ((_, (_, _, SOME _)) :: xs) ((fai, suc), inf_list) =
evaluate_the_tactics xs ((fai, suc + 1), inf_list)
\<close>
text "Now we build a tactic by combining lists of tactics"
ML \<open>
(*given a list of tactics to be applied in sequence (i.e., they
follow a skeleton), we build a single tactic, interleaving
some tracing info to help with debugging.*)
fun step_by_step_tacs ctxt verbose (thm_tacs : (thm * tactic) list) : tactic =
let
fun interleave_tacs [] [] = all_tac
| interleave_tacs (tac1 :: tacs1) (tac2 :: tacs2) =
EVERY [tac1, tac2]
THEN interleave_tacs tacs1 tacs2
val thms_to_traceprint =
map (fn thm => fn st =>
(*FIXME uses makestring*)
print_tac ctxt (@{make_string} thm) st)
in
if verbose then
ListPair.unzip thm_tacs
|> apfst (fn thms => enumerate 1 thms)
|> apfst thms_to_traceprint
|> uncurry interleave_tacs
else EVERY (map #2 thm_tacs)
end
\<close>
ML \<open>
(*apply step_by_step_tacs to all problems under test*)
fun narrated_tactics ctxt =
map (map (#3 #> the)
#> step_by_step_tacs ctxt false)
the_tactics;
(*produce thm*)
(*use narrated_tactics to reconstruct all problems under test*)
if test_all @{context} then []
else
map (fn (prob_name, tac) =>
TPTP_Reconstruct.reconstruct @{context}
(fn _ => tac) prob_name)
(ListPair.zip (prob_names, narrated_tactics @{context}))
\<close>
subsection "Manually using 'piecemeal' approach"
text "Another testing possibility involves manually creating a lemma
and running through the list of tactics generating to prove that lemma. The following code shows the goal of each problem under test, and then for each problem returns the list of tactics which can be invoked individually as shown below."
ML \<open>
fun show_goal ctxt prob_name =
let
val thy = Proof_Context.theory_of ctxt
val pannot = TPTP_Reconstruct.get_pannot_of_prob thy prob_name
in
#meta pannot
|> filter (fn (_, info) =>
#role info = TPTP_Syntax.Role_Conjecture)
|> hd
|> snd |> #fmla
|> cterm_of thy
end;
if test_all @{context} then []
else
map (show_goal @{context}) prob_names;
\<close>
ML \<open>
(*project out the list of tactics from "the_tactics"*)
val just_the_tacs =
map (map (#3 #> the #> #2))
the_tactics;
map length just_the_tacs
\<close>
ML \<open>
(*like just_the_tacs, but extract the thms, to inspect their thys*)
val just_the_thms =
map (map (#3 #> the #> #1))
the_tactics;
map length just_the_thms;
\<close>
ML \<open>
(*Show the skeleton-level inference which is done by each element of just_the_tacs. This is useful when debugging using the technique shown next*)
if test_all @{context} orelse prob_names = [] then ()
else
the_tactics
|> hd
|> map #1
|> TPTP_Reconstruct_Library.enumerate 0
|> List.app (@{make_string} #> writeln)
\<close>
ML \<open>
fun leo2_tac_wrap ctxt prob_name step i st =
rtac (interpret_leo2_inference ctxt prob_name step) i st
\<close>
(*FIXME move these examples elsewhere*)
(*
lemma "\<forall>(Xj::TPTP_Interpret.ind) Xk::TPTP_Interpret.ind.
bnd_cCKB6_BLACK Xj Xk \<longrightarrow>
bnd_cCKB6_BLACK (bnd_s (bnd_s (bnd_s Xj))) (bnd_s Xk)"
apply (tactic {*nth (nth just_the_tacs 0) 0*})
apply (tactic {*nth (nth just_the_tacs 0) 1*})
apply (tactic {*nth (nth just_the_tacs 0) 2*})
apply (tactic {*nth (nth just_the_tacs 0) 3*})
apply (tactic {*nth (nth just_the_tacs 0) 4*})
apply (tactic {*nth (nth just_the_tacs 0) 5*})
ML_prf "nth (hd the_tactics) 6"
apply (tactic {*nth (nth just_the_tacs 0) 6*})
apply (tactic {*nth (nth just_the_tacs 0) 7*})
apply (tactic {*nth (nth just_the_tacs 0) 8*})
apply (tactic {*nth (nth just_the_tacs 0) 9*})
apply (tactic {*nth (nth just_the_tacs 0) 10*})
apply (tactic {*nth (nth just_the_tacs 0) 11*})
apply (tactic {*nth (nth just_the_tacs 0) 12*})
apply (tactic {*nth (nth just_the_tacs 0) 13*})
apply (tactic {*nth (nth just_the_tacs 0) 14*})
apply (tactic {*nth (nth just_the_tacs 0) 15*})
apply (tactic {*nth (nth just_the_tacs 0) 16*})
(*
apply (tactic {*
rtac (interpret_leo2_inference @{context} (hd prob_names) "8") 1
*})
apply (tactic {*
rtac (interpret_leo2_inference @{context} (hd prob_names) "7") 1
*})
apply (tactic {*
rtac (interpret_leo2_inference @{context} (hd prob_names) "6") 1
*})
(*
apply (tactic {*
rtac (interpret_leo2_inference @{context} (hd prob_names) "4") 1
*})
*)
*)
apply (tactic {*nth (nth just_the_tacs 0) 17*})
apply (tactic {*nth (nth just_the_tacs 0) 18*})
apply (tactic {*nth (nth just_the_tacs 0) 19*})
apply (tactic {*nth (nth just_the_tacs 0) 20*})
apply (tactic {*nth (nth just_the_tacs 0) 21*})
ML_prf "nth (hd the_tactics) 21"
ML_prf "nth (hd the_tactics) 22"
apply (tactic {*nth (nth just_the_tacs 0) 22*})
apply (tactic {*nth (nth just_the_tacs 0) 23*})
apply (tactic {*nth (nth just_the_tacs 0) 24*})
apply (tactic {*nth (nth just_the_tacs 0) 25*})
ML_prf "nth (hd the_tactics) 19"
apply (tactic {*
interpret_leo2_inference_wrap (hd prob_names) "8" 1
*})
apply (tactic {*
interpret_leo2_inference_wrap (hd prob_names) "7" 1
*})
apply (tactic {*
interpret_leo2_inference_wrap (hd prob_names) "6" 1
*})
apply (tactic {*
interpret_leo2_inference_wrap (hd prob_names) "4" 1
*})
ML_prf "nth (hd the_tactics) 20"
ML_prf "nth (hd the_tactics) 21"
ML_prf "nth (hd the_tactics) 22"
*)
(*
lemma "bnd_powersetE1 \<longrightarrow>
bnd_sepInPowerset \<longrightarrow>
(\<forall>A Xphi. bnd_subset (bnd_dsetconstr A Xphi) A)"
apply (tactic {*nth (nth just_the_tacs 0) 0*})
apply (tactic {*nth (nth just_the_tacs 0) 1*})
apply (tactic {*nth (nth just_the_tacs 0) 2*})
apply (tactic {*nth (nth just_the_tacs 0) 3*})
apply (tactic {*nth (nth just_the_tacs 0) 4*})
apply (tactic {*nth (nth just_the_tacs 0) 5*})
ML_prf "nth (hd the_tactics) 6"
apply (tactic {*nth (nth just_the_tacs 0) 6*})
apply (tactic {*nth (nth just_the_tacs 0) 7*})
apply (tactic {*nth (nth just_the_tacs 0) 8*})
apply (tactic {*nth (nth just_the_tacs 0) 9*})
apply (tactic {*nth (nth just_the_tacs 0) 10*})
apply (tactic {*nth (nth just_the_tacs 0) 11*})
apply (tactic {*nth (nth just_the_tacs 0) 12*})
apply (tactic {*nth (nth just_the_tacs 0) 13*})
apply (tactic {*nth (nth just_the_tacs 0) 14*})
apply (tactic {*nth (nth just_the_tacs 0) 15*})
apply (tactic {*nth (nth just_the_tacs 0) 16*})
apply (tactic {*nth (nth just_the_tacs 0) 17*})
apply (tactic {*nth (nth just_the_tacs 0) 18*})
apply (tactic {*nth (nth just_the_tacs 0) 19*})
apply (tactic {*nth (nth just_the_tacs 0) 20*})
apply (tactic {*nth (nth just_the_tacs 0) 21*})
apply (tactic {*nth (nth just_the_tacs 0) 22*})
apply (tactic {*nth (nth just_the_tacs 0) 23*})
apply (tactic {*nth (nth just_the_tacs 0) 24*})
apply (tactic {*nth (nth just_the_tacs 0) 25*})
(* apply (tactic {*nth (nth just_the_tacs 0) 26*}) *)
ML_prf "nth (hd the_tactics) 26"
apply (subgoal_tac "(\<not> (\<forall>A Xphi. bnd_subset (bnd_dsetconstr A Xphi) A)) =
True \<Longrightarrow>
(\<not> bnd_subset (bnd_dsetconstr bnd_sK1 bnd_sK2) bnd_sK1) =
True")
prefer 2
apply (thin_tac "(bnd_powersetE1 \<longrightarrow>
bnd_sepInPowerset \<longrightarrow>
(\<forall>A Xphi. bnd_subset (bnd_dsetconstr A Xphi) A)) =
False")
apply (tactic {*extcnf_combined_simulator_tac (hd prob_names) 1*})
apply (tactic {*extcnf_combined_simulator_tac (hd prob_names) 1*})
apply (tactic {*extcnf_combined_simulator_tac (hd prob_names) 1*})
apply (tactic {*extcnf_combined_simulator_tac (hd prob_names) 1*})
apply simp
(* apply (tactic {*nth (nth just_the_tacs 0) 26*}) *)
apply (tactic {*nth (nth just_the_tacs 0) 27*})
apply (tactic {*nth (nth just_the_tacs 0) 28*})
apply (tactic {*nth (nth just_the_tacs 0) 29*})
apply (tactic {*nth (nth just_the_tacs 0) 30*})
apply (tactic {*nth (nth just_the_tacs 0) 31*})
apply (tactic {*nth (nth just_the_tacs 0) 32*})
apply (tactic {*nth (nth just_the_tacs 0) 33*})
apply (tactic {*nth (nth just_the_tacs 0) 34*})
apply (tactic {*nth (nth just_the_tacs 0) 35*})
apply (tactic {*nth (nth just_the_tacs 0) 36*})
apply (tactic {*nth (nth just_the_tacs 0) 37*})
apply (tactic {*nth (nth just_the_tacs 0) 38*})
apply (tactic {*nth (nth just_the_tacs 0) 39*})
apply (tactic {*nth (nth just_the_tacs 0) 40*})
apply (tactic {*nth (nth just_the_tacs 0) 41*})
apply (tactic {*nth (nth just_the_tacs 0) 42*})
apply (tactic {*nth (nth just_the_tacs 0) 43*})
apply (tactic {*nth (nth just_the_tacs 0) 44*})
apply (tactic {*nth (nth just_the_tacs 0) 45*})
apply (tactic {*nth (nth just_the_tacs 0) 46*})
apply (tactic {*nth (nth just_the_tacs 0) 47*})
apply (tactic {*nth (nth just_the_tacs 0) 48*})
apply (tactic {*nth (nth just_the_tacs 0) 49*})
apply (tactic {*nth (nth just_the_tacs 0) 50*})
apply (tactic {*nth (nth just_the_tacs 0) 51*})
done
*)
(*
We can use just_the_tacs as follows:
(this is from SEV012^5.p.out)
lemma "((\<forall>(Xx :: bool) (Xy :: bool). True \<longrightarrow> True) \<and>
(\<forall>(Xx :: bool) (Xy :: bool) (Xz :: bool). True \<and> True \<longrightarrow> True)) \<and>
(\<lambda>(Xx :: bool) (Xy :: bool). True) = (\<lambda>Xx Xy. True)"
apply (tactic {*nth (nth just_the_tacs 0) 0*})
apply (tactic {*nth (nth just_the_tacs 0) 1*})
apply (tactic {*nth (nth just_the_tacs 0) 2*})
apply (tactic {*nth (nth just_the_tacs 0) 3*})
apply (tactic {*nth (nth just_the_tacs 0) 4*})
apply (tactic {*nth (nth just_the_tacs 0) 5*})
ML_prf "nth (hd the_tactics) 6"
apply (tactic {*nth (nth just_the_tacs 0) 6*})
apply (tactic {*nth (nth just_the_tacs 0) 7*})
apply (tactic {*nth (nth just_the_tacs 0) 8*})
apply (tactic {*nth (nth just_the_tacs 0) 9*})
apply (tactic {*nth (nth just_the_tacs 0) 10*})
apply (tactic {*nth (nth just_the_tacs 0) 11*})
apply (tactic {*nth (nth just_the_tacs 0) 12*})
apply (tactic {*nth (nth just_the_tacs 0) 13*})
apply (tactic {*nth (nth just_the_tacs 0) 14*})
apply (tactic {*nth (nth just_the_tacs 0) 15*})
apply (tactic {*nth (nth just_the_tacs 0) 16*})
apply (tactic {*nth (nth just_the_tacs 0) 17*})
apply (tactic {*nth (nth just_the_tacs 0) 18*})
apply (tactic {*nth (nth just_the_tacs 0) 19*})
apply (tactic {*nth (nth just_the_tacs 0) 20*})
apply (tactic {*nth (nth just_the_tacs 0) 21*})
apply (tactic {*nth (nth just_the_tacs 0) 22*})
done
(*
We could also use previous definitions directly,
e.g. the following should prove the goal at a go:
- apply (tactic {*narrated_tactics |> hd |> hd*})
- apply (tactic {*
TPTP_Reconstruct.naive_reconstruct_tac
interpret_leo2_inference
(hd prob_names)
@{context}*})
(Note that the previous two methods don't work in this
"lemma" testing mode, not sure why. The previous methods
(producing the thm values directly) should work though.)
*)
*)
section "Testing against benchmark"
ML \<open>
(*if reconstruction_info value is NONE then a big error must have occurred*)
type reconstruction_info =
((int(*no of failures*) * int(*no of successes*)) *
(TPTP_Reconstruct.rolling_stock * term option(*inference formula*) * int (*number of times the inference occurs in the skeleton*)) list) option
datatype proof_contents =
No_info
| Empty
| Nonempty of reconstruction_info
(*To make output less cluttered in whole-run tests*)
fun erase_inference_fmlas (Nonempty (SOME (outline, inf_info))) =
Nonempty (SOME (outline, map (fn (inf_name, _, count) => (inf_name, NONE, count)) inf_info))
| erase_inference_fmlas x = x
\<close>
ML \<open>
(*Report on how many inferences in a proof are reconstructed, and give some
info about the inferences for which reconstruction failed.*)
fun test_partial_reconstruction thy prob_file =
let
val prob_name =
prob_file
|> Path.file_name
|> TPTP_Problem_Name.Nonstandard
val thy' =
try
(TPTP_Reconstruct.import_thm
true
[Path.dir prob_file, Path.explode "$TPTP"]
prob_file leo2_on_load)
thy
val ctxt' =
if is_some thy' then SOME (Proof_Context.init_global (the thy')) else NONE
(*to test if proof is empty*)
val fms =
if is_some thy'
then SOME (TPTP_Reconstruct.get_fmlas_of_prob (the thy') prob_name)
else NONE
val the_tactics =
if is_some thy' then
SOME (TPTP_Reconstruct.naive_reconstruct_tacs (* metis_based_reconstruction_tac *)
interpret_leo2_inference (* auto_based_reconstruction_tac *) (* oracle_based_reconstruction_tac *) prob_name (the ctxt'))
else NONE
(* val _ = tracing ("tt=" ^ @{make_string} the_tactics) *)
val skeleton =
if is_some thy' then
SOME (TPTP_Reconstruct.make_skeleton (the ctxt')
(TPTP_Reconstruct.get_pannot_of_prob (the thy') prob_name))
else NONE
val skeleton_and_tactics =
if is_some thy' then
SOME (ListPair.zip (the skeleton, the the_tactics))
else NONE
val result =
if is_some thy' then
SOME (evaluate_the_tactics (the skeleton_and_tactics)
((0, 0), []))
else NONE
(*strip node names*)
val result' =
if is_some result then SOME (apsnd (map #2) (the result)) else NONE
in
if is_some fms andalso List.null (the fms) then Empty
else Nonempty result'
end
\<close>
ML \<open>
(*default timeout is 1 min*)
fun reconstruct timeout light_output file thy =
let
val timer = Timer.startRealTimer ()
in
Timeout.apply (Time.fromSeconds (if timeout = 0 then 60 else timeout))
(test_partial_reconstruction thy
#> light_output ? erase_inference_fmlas
#> @{make_string} (* FIXME *)
#> (fn s => report (Proof_Context.init_global thy) (@{make_string} file ^ " === " ^ s ^
" t=" ^ (Timer.checkRealTimer timer |> Time.toMilliseconds |> @{make_string}))))
file
end
\<close>
ML \<open>
(*this version of "reconstruct" builds theorems, instead of lists of reconstructed inferences*)
(*default timeout is 1 min*)
fun reconstruct timeout file thy =
let
val timer = Timer.startRealTimer ()
val thy' =
TPTP_Reconstruct.import_thm true
[Path.dir file, Path.explode "$TPTP"]
file leo2_on_load thy
val ctxt = Proof_Context.init_global thy' (*FIXME pass ctxt instead of thy*)
val prob_name =
file
|> Path.file_name
|> TPTP_Problem_Name.Nonstandard
in
Timeout.apply (Time.fromSeconds (if timeout = 0 then 60 else timeout))
(fn prob_name =>
(can
(TPTP_Reconstruct.reconstruct ctxt (fn prob_name =>
TPTP_Reconstruct.naive_reconstruct_tac ctxt interpret_leo2_inference prob_name (* oracle_based_reconstruction_tac *))) prob_name )
|> (fn s => report ctxt (Path.print file ^ " === " ^ Bool.toString s ^
" t=" ^ (Timer.checkRealTimer timer |> Time.toMilliseconds |> @{make_string}))))
prob_name
end
\<close>
ML \<open>
fun reconstruction_test timeout ctxt =
test_fn ctxt
(fn file => reconstruct timeout file (Proof_Context.theory_of ctxt))
"reconstructor"
()
\<close>
ML \<open>
datatype examination_results =
Whole_proof of string(*filename*) * proof_contents
| Specific_rule of string(*filename*) * string(*inference rule*) * term option list
(*Look out for failures reconstructing a particular inference rule*)
fun filter_failures inference_name (Whole_proof (filename, results)) =
let
val filtered_results =
case results of
Nonempty (SOME results') =>
#2 results'
|> maps (fn (stock as TPTP_Reconstruct.Annotated_step (_, inf_name), inf_fmla, _) =>
if inf_name = inference_name then [inf_fmla] else [])
| _ => []
in Specific_rule (filename, inference_name, filtered_results) end
(*Returns detailed info about a proof-reconstruction attempt.
If rule_name is specified then the related failed inferences
are returned, otherwise all failed inferences are returned.*)
fun examine_failed_inferences ctxt filename rule_name =
let
val thy = Proof_Context.theory_of ctxt
val prob_file = Path.explode filename
val results =
if test_all ctxt then No_info
else test_partial_reconstruction thy prob_file
in
Whole_proof (filename, results)
|> is_some rule_name ? (fn x =>
filter_failures (the rule_name) x)
end
\<close>
ML \<open>
exception NONSENSE
fun annotation_or_id (TPTP_Reconstruct.Step n) = n
| annotation_or_id (TPTP_Reconstruct.Annotated_step (n, anno)) = anno
| annotation_or_id TPTP_Reconstruct.Assumed = "assumption"
| annotation_or_id TPTP_Reconstruct.Unconjoin = "conjI"
| annotation_or_id TPTP_Reconstruct.Caboose = "(end)"
| annotation_or_id (TPTP_Reconstruct.Synth_step s) = s
| annotation_or_id (TPTP_Reconstruct.Split (split_node, soln_node, _)) = "split_at " ^ split_node ^ " " ^ soln_node;
fun count_failures (Whole_proof (_, No_info)) = raise NONSENSE
| count_failures (Whole_proof (_, Empty)) = raise NONSENSE
| count_failures (Whole_proof (_, Nonempty NONE)) = raise NONSENSE
| count_failures (Whole_proof (_, Nonempty (SOME (((n, _), _))))) = n
| count_failures (Specific_rule (_, _, t)) = length t
fun pre_classify_failures [] alist = alist
| pre_classify_failures ((stock, _, _) :: xs) alist =
let
val inf = annotation_or_id stock
val count = AList.lookup (=) alist inf
in
if is_none count
then pre_classify_failures xs ((inf, 1) :: alist)
else
pre_classify_failures xs
(AList.update (=) (inf, the count + 1) alist)
end
fun classify_failures (Whole_proof (_, Nonempty (SOME (((_, _), inferences))))) = pre_classify_failures inferences []
| classify_failures (Specific_rule (_, rule, t)) = [(rule, length t)]
| classify_failures _ = raise NONSENSE
\<close>
ML \<open>
val regressions = map (fn s => "$THF_PROOFS/" ^ s)
["SEV405^5.p.out",
(*"SYO377^5.p.out", Always seems to raise Interrupt on my laptop -- probably because node 475 has lots of premises*)
"PUZ031^5.p.out",
"ALG001^5.p.out",
"SYO238^5.p.out",
(*"SEV158^5.p.out", This is big*)
"SYO285^5.p.out",
"../SYO285^5.p.out_reduced",
(* "SYO225^5.p.out", This is big*)
"SYO291^5.p.out",
"SET669^3.p.out",
"SEV233^5.p.out",
(*"SEU511^1.p.out", This is big*)
"SEV161^5.p.out",
"SEV012^5.p.out",
"SYO035^1.p.out",
"SYO291^5.p.out",
"SET741^4.p.out", (*involves both definitions and contorted splitting. has nice graph.*)
"SEU548^2.p.out",
"SEU513^2.p.out",
"SYO006^1.p.out",
"SYO371^5.p.out" (*has contorted splitting, like SYO006^1.p.out, but doesn't involve definitions*)
]
\<close>
ML \<open>
val experiment = examine_failed_inferences @{context}
(List.last regressions) NONE;
(*
val experiment_focus =
filter_failures "extcnf_combined" experiment;
*)
(*
count_failures experiment_focus
classify_failures experiment
*)
\<close>
text "Run reconstruction on all problems in a benchmark (provided via a script)
and report on partial success."
declare [[
tptp_test_all = true,
tptp_test_timeout = 10
]]
ML \<open>
(*problem source*)
val tptp_probs_dir =
Path.explode "$THF_PROOFS"
|> Path.expand;
\<close>
ML \<open>
if test_all @{context} then
(report @{context} "Reconstructing proofs";
S timed_test (reconstruction_test (get_timeout @{context})) @{context} (TPTP_Syntax.get_file_list tptp_probs_dir))
else ()
\<close>
(*
Debugging strategy:
1) get list of all proofs
2) order by size
3) try to construct each in turn, given some timeout
Use this to find the smallest failure, then debug that.
*)
end
|
function whitehKernDisplay(kern, spacing)
% WHITEHKERNDISPLAY Display parameters of the WHITEH kernel.
% FORMAT
% DESC displays the parameters of the white noise
% kernel and the kernel type to the console.
% ARG kern : the kernel to display.
%
% FORMAT does the same as above, but indents the display according
% to the amount specified.
% ARG kern : the kernel to display.
% ARG spacing : how many spaces to indent the display of the kernel by.
%
% SEEALSO : whiteKernParamInit, modelDisplay, kernDisplay
%
% COPYRIGHT : Neil D. Lawrence, 2004, 2005, 2006
% KERN
if nargin > 1
spacing = repmat(32, 1, spacing);
else
spacing = [];
end
spacing = char(spacing);
fprintf(spacing);
fprintf('White Noise Variance: %2.4f\n', kern.variance)
|
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Regression" data-toc-modified-id="Regression-1"><span class="toc-item-num">1 </span>Regression</a></span><ul class="toc-item"><li><ul class="toc-item"><li><span><a href="#Bibliography:-Chapter-8-Ivezic+" data-toc-modified-id="Bibliography:-Chapter-8-Ivezic+-1.0.1"><span class="toc-item-num">1.0.1 </span>Bibliography: Chapter 8 Ivezic+</a></span></li></ul></li></ul></li><li><span><a href="#Regression:" data-toc-modified-id="Regression:-2"><span class="toc-item-num">2 </span>Regression:</a></span></li><li><span><a href="#Metrics:" data-toc-modified-id="Metrics:-3"><span class="toc-item-num">3 </span>Metrics:</a></span><ul class="toc-item"><li><span><a href="#Mean-squared-error-(MSE)" data-toc-modified-id="Mean-squared-error-(MSE)-3.1"><span class="toc-item-num">3.1 </span>Mean squared error (MSE)</a></span></li><li><span><a href="#$MSE-\equiv-\frac{1}{n}-\sum_i-(y_i---\hat{y}_i)^2$" data-toc-modified-id="$MSE-\equiv-\frac{1}{n}-\sum_i-(y_i---\hat{y}_i)^2$-3.2"><span class="toc-item-num">3.2 </span>$MSE \equiv \frac{1}{n} \sum_i (y_i - \hat{y}_i)^2$</a></span></li><li><span><a href="#Coefficient-of-determination-(R$^2$)" data-toc-modified-id="Coefficient-of-determination-(R$^2$)-3.3"><span class="toc-item-num">3.3 </span>Coefficient of determination (R$^2$)</a></span></li><li><span><a href="#$R^2-\equiv-1----\frac{SS_{res}}{SS_{tot}}$," data-toc-modified-id="$R^2-\equiv-1----\frac{SS_{res}}{SS_{tot}}$,-3.4"><span class="toc-item-num">3.4 </span>$R^2 \equiv 1 - \frac{SS_{res}}{SS_{tot}}$,</a></span><ul class="toc-item"><li><span><a href="#$-SS_{res}-=-\sum_i-(y_i---\hat{y}_i)^2$" data-toc-modified-id="$-SS_{res}-=-\sum_i-(y_i---\hat{y}_i)^2$-3.4.1"><span class="toc-item-num">3.4.1 </span>$ SS_{res} = \sum_i (y_i - \hat{y}_i)^2$</a></span></li><li><span><a href="#$-SS_{tot}-=-\sum_i-(y_i---\bar{y})^2$" data-toc-modified-id="$-SS_{tot}-=-\sum_i-(y_i---\bar{y})^2$-3.4.2"><span class="toc-item-num">3.4.2 </span>$ SS_{tot} = \sum_i (y_i - \bar{y})^2$</a></span></li></ul></li><li><span><a href="#Variance-and-bias" data-toc-modified-id="Variance-and-bias-3.5"><span class="toc-item-num">3.5 </span>Variance and bias</a></span></li><li><span><a href="#$Var_{\hat{\theta}}-=-E_{\hat{\theta}}\biggl[-\bigl(\hat{\theta}---E_{\hat{\theta}}[\hat{\theta}]\bigr)^2\biggr]$" data-toc-modified-id="$Var_{\hat{\theta}}-=-E_{\hat{\theta}}\biggl[-\bigl(\hat{\theta}---E_{\hat{\theta}}[\hat{\theta}]\bigr)^2\biggr]$-3.6"><span class="toc-item-num">3.6 </span>$Var_{\hat{\theta}} = E_{\hat{\theta}}\biggl[ \bigl(\hat{\theta} - E_{\hat{\theta}}[\hat{\theta}]\bigr)^2\biggr]$</a></span></li><li><span><a href="#$Bias_{\hat{\theta}}-=-E_{\hat{\theta}}---\theta$" data-toc-modified-id="$Bias_{\hat{\theta}}-=-E_{\hat{\theta}}---\theta$-3.7"><span class="toc-item-num">3.7 </span>$Bias_{\hat{\theta}} = E_{\hat{\theta}} - \theta$</a></span></li><li><span><a href="#Relation-between-MSE,-variance-and-bias" data-toc-modified-id="Relation-between-MSE,-variance-and-bias-3.8"><span class="toc-item-num">3.8 </span>Relation between MSE, variance and bias</a></span></li></ul></li><li><span><a href="#Linear-regression" data-toc-modified-id="Linear-regression-4"><span class="toc-item-num">4 </span>Linear regression</a></span><ul class="toc-item"><li><span><a href="#Least-squares-regression-for-linear-regression" data-toc-modified-id="Least-squares-regression-for-linear-regression-4.1"><span class="toc-item-num">4.1 </span>Least squares regression for linear regression</a></span></li><li><span><a href="#1.-Ordinary-least-squares" data-toc-modified-id="1.-Ordinary-least-squares-4.2"><span class="toc-item-num">4.2 </span>1. Ordinary least squares</a></span><ul class="toc-item"><li><span><a href="#$\min-RSS-=-\min-\sum\limits_{i=1}^{n}-(y_i---\theta_0---\theta_1-x_i)^2$" data-toc-modified-id="$\min-RSS-=-\min-\sum\limits_{i=1}^{n}-(y_i---\theta_0---\theta_1-x_i)^2$-4.2.1"><span class="toc-item-num">4.2.1 </span>$\min RSS = \min \sum\limits_{i=1}^{n} (y_i - \theta_0 - \theta_1 x_i)^2$</a></span></li></ul></li><li><span><a href="#$\hat{\theta}_{1,-OLS}-=-\frac{\sum\limits_{i=1}^n-(x_i---\bar{x})-(y_i---\bar{y})}{\sum\limits_{i=1}^n-(x_i---\bar{x})^2}-=-\frac{S_{xy}}{S_{xx}}$" data-toc-modified-id="$\hat{\theta}_{1,-OLS}-=-\frac{\sum\limits_{i=1}^n-(x_i---\bar{x})-(y_i---\bar{y})}{\sum\limits_{i=1}^n-(x_i---\bar{x})^2}-=-\frac{S_{xy}}{S_{xx}}$-4.3"><span class="toc-item-num">4.3 </span>$\hat{\theta}_{1, OLS} = \frac{\sum\limits_{i=1}^n (x_i - \bar{x}) (y_i - \bar{y})}{\sum\limits_{i=1}^n (x_i - \bar{x})^2} = \frac{S_{xy}}{S_{xx}}$</a></span></li><li><span><a href="#$\hat{\theta}_{0,-OLS}-=-\bar{y}---\hat{\theta}_{1,OLS}-~\bar{x}$" data-toc-modified-id="$\hat{\theta}_{0,-OLS}-=-\bar{y}---\hat{\theta}_{1,OLS}-~\bar{x}$-4.4"><span class="toc-item-num">4.4 </span>$\hat{\theta}_{0, OLS} = \bar{y} - \hat{\theta}_{1,OLS} ~\bar{x}$</a></span></li><li><span><a href="#$\hat{\sigma}^2-=-S^2-=-\frac{RSS}{n---2}$" data-toc-modified-id="$\hat{\sigma}^2-=-S^2-=-\frac{RSS}{n---2}$-4.5"><span class="toc-item-num">4.5 </span>$\hat{\sigma}^2 = S^2 = \frac{RSS}{n - 2}$</a></span></li><li><span><a href="#$\hat{\theta}_{1,-OLS}-\sim-N\biggl(\theta_1,-\frac{\sigma^2}{S_{XX}}\biggr)$" data-toc-modified-id="$\hat{\theta}_{1,-OLS}-\sim-N\biggl(\theta_1,-\frac{\sigma^2}{S_{XX}}\biggr)$-4.6"><span class="toc-item-num">4.6 </span>$\hat{\theta}_{1, OLS} \sim N\biggl(\theta_1, \frac{\sigma^2}{S_{XX}}\biggr)$</a></span></li><li><span><a href="#$\hat{\theta}_{0,-OLS}-\sim-N\biggl(\theta_0,-\sigma^2-\biggl(\frac{1}{n}-+-\frac{\bar{x}^2}{S_{XX}}\biggr)\biggr)$" data-toc-modified-id="$\hat{\theta}_{0,-OLS}-\sim-N\biggl(\theta_0,-\sigma^2-\biggl(\frac{1}{n}-+-\frac{\bar{x}^2}{S_{XX}}\biggr)\biggr)$-4.7"><span class="toc-item-num">4.7 </span>$\hat{\theta}_{0, OLS} \sim N\biggl(\theta_0, \sigma^2 \biggl(\frac{1}{n} + \frac{\bar{x}^2}{S_{XX}}\biggr)\biggr)$</a></span></li><li><span><a href="#$\hat{\sigma}^2-\sim-\biggl(\frac{\sigma^2}{n---2}-\biggr)-\chi_{n-2}^{2}$" data-toc-modified-id="$\hat{\sigma}^2-\sim-\biggl(\frac{\sigma^2}{n---2}-\biggr)-\chi_{n-2}^{2}$-4.8"><span class="toc-item-num">4.8 </span>$\hat{\sigma}^2 \sim \biggl(\frac{\sigma^2}{n - 2} \biggr) \chi_{n-2}^{2}$</a></span></li><li><span><a href="#$-T-=-\frac{\hat{\theta_1}---\theta_1}{SE}$" data-toc-modified-id="$-T-=-\frac{\hat{\theta_1}---\theta_1}{SE}$-4.9"><span class="toc-item-num">4.9 </span>$ T = \frac{\hat{\theta_1} - \theta_1}{SE}$</a></span></li><li><span><a href="#$y(x)-=-\hat{\theta}_0-+-\hat{\theta}_1-x-\pm-t_{\alpha/2,-n---2}-~-S-~-\sqrt{1-+-\frac{1}{n}-\frac{(x---\bar{x})^2}{S_{xx}}}$" data-toc-modified-id="$y(x)-=-\hat{\theta}_0-+-\hat{\theta}_1-x-\pm-t_{\alpha/2,-n---2}-~-S-~-\sqrt{1-+-\frac{1}{n}-\frac{(x---\bar{x})^2}{S_{xx}}}$-4.10"><span class="toc-item-num">4.10 </span>$y(x) = \hat{\theta}_0 + \hat{\theta}_1 x \pm t_{\alpha/2, n - 2} ~ S ~ \sqrt{1 + \frac{1}{n} \frac{(x - \bar{x})^2}{S_{xx}}}$</a></span></li><li><span><a href="#2.-Maximum-likelihood-estimator-(MLE)" data-toc-modified-id="2.-Maximum-likelihood-estimator-(MLE)-4.11"><span class="toc-item-num">4.11 </span>2. Maximum likelihood estimator (MLE)</a></span></li><li><span><a href="#$p(\lbrace-y_i-\rbrace-|-\lbrace-x_i-\rbrace,-\theta)-=-\prod\limits_{i-=-1}^{N}-\frac{1}{\sqrt{2-\pi}-\sigma_i}-\exp-\biggl(-\frac{--(y_i---(\theta_0-+-\theta_1-x_i))^2}{2-\sigma_i^2}-\biggr)$" data-toc-modified-id="$p(\lbrace-y_i-\rbrace-|-\lbrace-x_i-\rbrace,-\theta)-=-\prod\limits_{i-=-1}^{N}-\frac{1}{\sqrt{2-\pi}-\sigma_i}-\exp-\biggl(-\frac{--(y_i---(\theta_0-+-\theta_1-x_i))^2}{2-\sigma_i^2}-\biggr)$-4.12"><span class="toc-item-num">4.12 </span>$p(\lbrace y_i \rbrace | \lbrace x_i \rbrace, \theta) = \prod\limits_{i = 1}^{N} \frac{1}{\sqrt{2 \pi} \sigma_i} \exp \biggl( \frac{- (y_i - (\theta_0 + \theta_1 x_i))^2}{2 \sigma_i^2} \biggr)$</a></span></li><li><span><a href="#$\log(L)-=-\log-p(\lbrace-y_i-\rbrace-|-\lbrace-x_i-\rbrace,-\theta)-=-\sum\limits_{i-=-1}^{N}--\bigl(-\frac{--(y_i---(\theta_0-+-\theta_1-x_i))^2}{2-\sigma_i^2}-\bigr)$" data-toc-modified-id="$\log(L)-=-\log-p(\lbrace-y_i-\rbrace-|-\lbrace-x_i-\rbrace,-\theta)-=-\sum\limits_{i-=-1}^{N}--\bigl(-\frac{--(y_i---(\theta_0-+-\theta_1-x_i))^2}{2-\sigma_i^2}-\bigr)$-4.13"><span class="toc-item-num">4.13 </span>$\log(L) = \log p(\lbrace y_i \rbrace | \lbrace x_i \rbrace, \theta) = \sum\limits_{i = 1}^{N} \bigl( \frac{- (y_i - (\theta_0 + \theta_1 x_i))^2}{2 \sigma_i^2} \bigr)$</a></span></li><li><span><a href="#$P(\theta-|-\lbrace-y_i-\rbrace,-\lbrace-x_i-\rbrace)-=-P(\lbrace-y_i-\rbrace-|-\lbrace-x_i-\rbrace,-\theta)-~-\frac{p(\theta)}{p(y_i)}$" data-toc-modified-id="$P(\theta-|-\lbrace-y_i-\rbrace,-\lbrace-x_i-\rbrace)-=-P(\lbrace-y_i-\rbrace-|-\lbrace-x_i-\rbrace,-\theta)-~-\frac{p(\theta)}{p(y_i)}$-4.14"><span class="toc-item-num">4.14 </span>$P(\theta | \lbrace y_i \rbrace, \lbrace x_i \rbrace) = P(\lbrace y_i \rbrace | \lbrace x_i \rbrace, \theta) ~ \frac{p(\theta)}{p(y_i)}$</a></span></li><li><span><a href="#Online-estimation" data-toc-modified-id="Online-estimation-4.15"><span class="toc-item-num">4.15 </span>Online estimation</a></span><ul class="toc-item"><li><span><a href="#Diabetes-dataset-example" data-toc-modified-id="Diabetes-dataset-example-4.15.1"><span class="toc-item-num">4.15.1 </span>Diabetes dataset example</a></span></li></ul></li><li><span><a href="#3.-Least-squares-in-matrix-form" data-toc-modified-id="3.-Least-squares-in-matrix-form-4.16"><span class="toc-item-num">4.16 </span>3. Least squares in matrix form</a></span></li><li><span><a href="#$y-=-{\bf-M}-~-\theta$" data-toc-modified-id="$y-=-{\bf-M}-~-\theta$-4.17"><span class="toc-item-num">4.17 </span>$y = {\bf M} ~ \theta$</a></span></li><li><span><a href="#$y-=-\begin{bmatrix}-y_0-\\-y_1-\\-.-\\-y_{N-1}-\end{bmatrix}$" data-toc-modified-id="$y-=-\begin{bmatrix}-y_0-\\-y_1-\\-.-\\-y_{N-1}-\end{bmatrix}$-4.18"><span class="toc-item-num">4.18 </span>$y = \begin{bmatrix} y_0 \\ y_1 \\ . \\ y_{N-1} \end{bmatrix}$</a></span></li><li><span><a href="#$\theta-=-\begin{bmatrix}-\theta_0-\\-\theta_1-\end{bmatrix}$" data-toc-modified-id="$\theta-=-\begin{bmatrix}-\theta_0-\\-\theta_1-\end{bmatrix}$-4.19"><span class="toc-item-num">4.19 </span>$\theta = \begin{bmatrix} \theta_0 \\ \theta_1 \end{bmatrix}$</a></span></li><li><span><a href="#${\bf-M}-=-\begin{bmatrix}-1-&-x_0-\\-1-&-x_1-\\-...-&-...-\\-1-&-x_{N-1}-\\-\end{bmatrix}$" data-toc-modified-id="${\bf-M}-=-\begin{bmatrix}-1-&-x_0-\\-1-&-x_1-\\-...-&-...-\\-1-&-x_{N-1}-\\-\end{bmatrix}$-4.20"><span class="toc-item-num">4.20 </span>${\bf M} = \begin{bmatrix} 1 & x_0 \\ 1 & x_1 \\ ... & ... \\ 1 & x_{N-1} \\ \end{bmatrix}$</a></span></li><li><span><a href="#$-C-=-\begin{bmatrix}-\sigma_0^2-&-0-&-.-&-0-\\-0-&-\sigma_1^2-&-.-&-0-\\-.-&-.-&-.-&-.-\\-0-&-0-&-.-&-\sigma_{N---1}^2\\-\end{bmatrix}$" data-toc-modified-id="$-C-=-\begin{bmatrix}-\sigma_0^2-&-0-&-.-&-0-\\-0-&-\sigma_1^2-&-.-&-0-\\-.-&-.-&-.-&-.-\\-0-&-0-&-.-&-\sigma_{N---1}^2\\-\end{bmatrix}$-4.21"><span class="toc-item-num">4.21 </span>$ C = \begin{bmatrix} \sigma_0^2 & 0 & . & 0 \\ 0 & \sigma_1^2 & . & 0 \\ . & . & . & . \\ 0 & 0 & . & \sigma_{N - 1}^2\\ \end{bmatrix}$</a></span></li><li><span><a href="#${\bf-\hat{\theta}}-=-({\bf-M}^T-C^{-1}-{\bf-M})^{-1}-({\bf-M}^T-C^{-1}-{\bf-y})$" data-toc-modified-id="${\bf-\hat{\theta}}-=-({\bf-M}^T-C^{-1}-{\bf-M})^{-1}-({\bf-M}^T-C^{-1}-{\bf-y})$-4.22"><span class="toc-item-num">4.22 </span>${\bf \hat{\theta}} = ({\bf M}^T C^{-1} {\bf M})^{-1} ({\bf M}^T C^{-1} {\bf y})$</a></span></li><li><span><a href="#$({\bf-y}---{\bf-M}-~-\theta)^{-1}-C^{-1}-({\bf-y}----{\bf-M}-~-\theta)$" data-toc-modified-id="$({\bf-y}---{\bf-M}-~-\theta)^{-1}-C^{-1}-({\bf-y}----{\bf-M}-~-\theta)$-4.23"><span class="toc-item-num">4.23 </span>$({\bf y} - {\bf M} ~ \theta)^{-1} C^{-1} ({\bf y} - {\bf M} ~ \theta)$</a></span></li><li><span><a href="#$\Sigma_\theta-=-\begin{bmatrix}-\sigma_{\theta_0}^2-&-\dots-&-\sigma_{\theta_0-\theta_i}-&-\dots-\\-\vdots-&-\ddots-&-\vdots-&-\vdots-\\-\sigma_{\theta_0-\theta_i}-&-\dots-&-\sigma_{\theta_i}^2-\\--\vdots-&-\vdots-&-\vdots-&-\ddots-\\-\end{bmatrix}-=-[{\bf-M}^T-C^{-1}-{\bf-M}]^{-1}$" data-toc-modified-id="$\Sigma_\theta-=-\begin{bmatrix}-\sigma_{\theta_0}^2-&-\dots-&-\sigma_{\theta_0-\theta_i}-&-\dots-\\-\vdots-&-\ddots-&-\vdots-&-\vdots-\\-\sigma_{\theta_0-\theta_i}-&-\dots-&-\sigma_{\theta_i}^2-\\--\vdots-&-\vdots-&-\vdots-&-\ddots-\\-\end{bmatrix}-=-[{\bf-M}^T-C^{-1}-{\bf-M}]^{-1}$-4.24"><span class="toc-item-num">4.24 </span>$\Sigma_\theta = \begin{bmatrix} \sigma_{\theta_0}^2 & \dots & \sigma_{\theta_0 \theta_i} & \dots \\ \vdots & \ddots & \vdots & \vdots \\ \sigma_{\theta_0 \theta_i} & \dots & \sigma_{\theta_i}^2 \\ \vdots & \vdots & \vdots & \ddots \\ \end{bmatrix} = [{\bf M}^T C^{-1} {\bf M}]^{-1}$</a></span></li><li><span><a href="#4.-Polynomial-regression" data-toc-modified-id="4.-Polynomial-regression-4.25"><span class="toc-item-num">4.25 </span>4. Polynomial regression</a></span></li><li><span><a href="#$y_i-=-\theta_0-+-\theta_1-x_i-+-\theta_2-x_i^2-+-\theta_3-x_i^3$" data-toc-modified-id="$y_i-=-\theta_0-+-\theta_1-x_i-+-\theta_2-x_i^2-+-\theta_3-x_i^3$-4.26"><span class="toc-item-num">4.26 </span>$y_i = \theta_0 + \theta_1 x_i + \theta_2 x_i^2 + \theta_3 x_i^3$</a></span></li><li><span><a href="#$-M-=-\begin{bmatrix}
1-&-x_0-&-x_0^2-&-x_0^3-\\
1-&-x_1-&-x_1^2-&-x_1^3-\\
.-&-.-&-.-&-.-\\
1-&-x_N-&-x_N^2-&-x_N^3-\\
\end{bmatrix}$" data-toc-modified-id="$-M-=-\begin{bmatrix}
1-&-x_0-&-x_0^2-&-x_0^3-\\
1-&-x_1-&-x_1^2-&-x_1^3-\\
.-&-.-&-.-&-.-\\
1-&-x_N-&-x_N^2-&-x_N^3-\\
\end{bmatrix}$-4.27"><span class="toc-item-num">4.27 </span>$ M = \begin{bmatrix}
1 & x_0 & x_0^2 & x_0^3 \\
1 & x_1 & x_1^2 & x_1^3 \\
. & . & . & . \\
1 & x_N & x_N^2 & x_N^3 \\
\end{bmatrix}$</a></span></li></ul></li><li><span><a href="#Regularization" data-toc-modified-id="Regularization-5"><span class="toc-item-num">5 </span>Regularization</a></span><ul class="toc-item"><li><span><a href="#1.-Ridge-regression" data-toc-modified-id="1.-Ridge-regression-5.1"><span class="toc-item-num">5.1 </span>1. Ridge regression</a></span></li><li><span><a href="#$({\bf-y}---M~-\theta)^{-1}-C^{-1}({\bf-y}---M~-\theta)-+-\lambda~-|\theta^T-\theta|$" data-toc-modified-id="$({\bf-y}---M~-\theta)^{-1}-C^{-1}({\bf-y}---M~-\theta)-+-\lambda~-|\theta^T-\theta|$-5.2"><span class="toc-item-num">5.2 </span>$({\bf y} - M~ \theta)^{-1} C^{-1}({\bf y} - M~ \theta) + \lambda~ |\theta^T \theta|$</a></span></li><li><span><a href="#${\bf-\hat{\theta}}-=-({\bf-M}^T-C^{-1}-{\bf-M}-+-\lambda-I)^{-1}-({\bf-M}^T-C^{-1}-{\bf-y})$" data-toc-modified-id="${\bf-\hat{\theta}}-=-({\bf-M}^T-C^{-1}-{\bf-M}-+-\lambda-I)^{-1}-({\bf-M}^T-C^{-1}-{\bf-y})$-5.3"><span class="toc-item-num">5.3 </span>${\bf \hat{\theta}} = ({\bf M}^T C^{-1} {\bf M} + \lambda I)^{-1} ({\bf M}^T C^{-1} {\bf y})$</a></span><ul class="toc-item"><li><span><a href="#Bayes-equivalent" data-toc-modified-id="Bayes-equivalent-5.3.1"><span class="toc-item-num">5.3.1 </span>Bayes equivalent</a></span></li></ul></li><li><span><a href="#$-p(\theta)-\propto-\exp-\biggl(-\frac{--\lambda-(\theta^T-\theta)}{2}-\biggr)$" data-toc-modified-id="$-p(\theta)-\propto-\exp-\biggl(-\frac{--\lambda-(\theta^T-\theta)}{2}-\biggr)$-5.4"><span class="toc-item-num">5.4 </span>$ p(\theta) \propto \exp \biggl( \frac{- \lambda (\theta^T \theta)}{2} \biggr)$</a></span></li><li><span><a href="#$|{\bf-\theta}|^2-<-s$" data-toc-modified-id="$|{\bf-\theta}|^2-<-s$-5.5"><span class="toc-item-num">5.5 </span>$|{\bf \theta}|^2 < s$</a></span></li><li><span><a href="#2.-LASSO-regression" data-toc-modified-id="2.-LASSO-regression-5.6"><span class="toc-item-num">5.6 </span>2. LASSO regression</a></span></li><li><span><a href="#$({\bf-y}---\theta-{\bf-X})^{-1}({\bf-y}---\theta-{\bf-X})-+-\lambda-|\theta|$" data-toc-modified-id="$({\bf-y}---\theta-{\bf-X})^{-1}({\bf-y}---\theta-{\bf-X})-+-\lambda-|\theta|$-5.7"><span class="toc-item-num">5.7 </span>$({\bf y} - \theta {\bf X})^{-1}({\bf y} - \theta {\bf X}) + \lambda |\theta|$</a></span></li><li><span><a href="#$|{\bf-\theta}|-<-s$" data-toc-modified-id="$|{\bf-\theta}|-<-s$-5.8"><span class="toc-item-num">5.8 </span>$|{\bf \theta}| < s$</a></span><ul class="toc-item"><li><span><a href="#Understanding-Ridge-and-LASSO-regression" data-toc-modified-id="Understanding-Ridge-and-LASSO-regression-5.8.1"><span class="toc-item-num">5.8.1 </span>Understanding Ridge and LASSO regression</a></span></li></ul></li></ul></li><li><span><a href="#Comparison-between-ordinary,-Ridge-and-LASSO-regression" data-toc-modified-id="Comparison-between-ordinary,-Ridge-and-LASSO-regression-6"><span class="toc-item-num">6 </span>Comparison between ordinary, Ridge and LASSO regression</a></span><ul class="toc-item"><li><span><a href="#Choosing-the-regularization-parameter-$\lambda$" data-toc-modified-id="Choosing-the-regularization-parameter-$\lambda$-6.1"><span class="toc-item-num">6.1 </span>Choosing the regularization parameter $\lambda$</a></span></li><li><span><a href="#$-Err(\lambda)-=-k^{1}-\sum_k-N_k^{-1}-\sum\limits_{i}^{N_k}-\frac{[y_i---f(x_i-|-\theta)]^2}{\sigma_i^2}$" data-toc-modified-id="$-Err(\lambda)-=-k^{1}-\sum_k-N_k^{-1}-\sum\limits_{i}^{N_k}-\frac{[y_i---f(x_i-|-\theta)]^2}{\sigma_i^2}$-6.2"><span class="toc-item-num">6.2 </span>$ Err(\lambda) = k^{1} \sum_k N_k^{-1} \sum\limits_{i}^{N_k} \frac{[y_i - f(x_i | \theta)]^2}{\sigma_i^2}$</a></span></li></ul></li><li><span><a href="#Outliers" data-toc-modified-id="Outliers-7"><span class="toc-item-num">7 </span>Outliers</a></span><ul class="toc-item"><li><span><a href="#Huber-loss" data-toc-modified-id="Huber-loss-7.1"><span class="toc-item-num">7.1 </span>Huber loss</a></span><ul class="toc-item"><li><span><a href="#$-\sum\limits_{i=1}^N-e(y_i|y)$" data-toc-modified-id="$-\sum\limits_{i=1}^N-e(y_i|y)$-7.1.1"><span class="toc-item-num">7.1.1 </span>$ \sum\limits_{i=1}^N e(y_i|y)$</a></span></li><li><span><a href="#$\begin{equation}
--\phi(t)=\left\{
--\begin{array}{@{}ll@{}}
----\frac{1}{2}-t^2,-&-\text{if}\-|t|\le-c-\\
----c|t|---\frac{1}{2}-c^2,-&-\text{otherwise}
--\end{array}\right.
\end{equation}$" data-toc-modified-id="$\begin{equation}
--\phi(t)=\left\{
--\begin{array}{@{}ll@{}}
----\frac{1}{2}-t^2,-&-\text{if}\-|t|\le-c-\\
----c|t|---\frac{1}{2}-c^2,-&-\text{otherwise}
--\end{array}\right.
\end{equation}$-7.1.2"><span class="toc-item-num">7.1.2 </span>$\begin{equation}
\phi(t)=\left\{
\begin{array}{@{}ll@{}}
\frac{1}{2} t^2, & \text{if}\ |t|\le c \\
c|t| - \frac{1}{2} c^2, & \text{otherwise}
\end{array}\right.
\end{equation}$</a></span></li></ul></li><li><span><a href="#Bayesian-Outlier-Methods" data-toc-modified-id="Bayesian-Outlier-Methods-7.2"><span class="toc-item-num">7.2 </span>Bayesian Outlier Methods</a></span></li></ul></li><li><span><a href="#Cross-Validation-Testing" data-toc-modified-id="Cross-Validation-Testing-8"><span class="toc-item-num">8 </span>Cross-Validation Testing</a></span></li></ul></div>
```python
%config InlineBackend.figure_format = 'retina'
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.style.use(['ggplot', 'assets/class.mplstyle'])
red = '#E24A33'
blue = '#348ABD'
purple = '#988ED5'
gray = '#777777'
yellow = '#FBC15E'
green = '#8EBA42'
pink = '#FFB5B8'
```
# Regression
### Bibliography: Chapter 8 Ivezic+
# Regression:
- Finding the relation between a dependent variable $y$ and a set of independent variables $\bf x$. It describes the expectation value of $y$ given $\bf x$, $E[y|{\bf x}]$.
- The dependent variable $y$ is also called **response variable**.
- The problem is to find the expectation of $y$ given $\bf x$:
$E[y|{\bf x}] = f({\bf x}, \theta) + \epsilon$
where $\epsilon$ is a random error.
Note that we estimate $E[y | {\bf x}]$, the conditional expectation of $y$ given $\bf x$, rather than $p(y, {\bf x})$, the joint distribution of $y$ and $\bf x$, which is a much harder problem to solve. Regression is a simpler problem: instead of determining the multidimensional pdf, we would like to infer the expectation of $y$ given $\bf x$.
**The goal of regression usually focuses on estimation of the parameters $\theta$ of the function and their confidence intervals.**
# Metrics:
## Mean squared error (MSE)
The mean squared error (MSE) or mean squared deviation (MSD) of an estimator measures the average of the squares of the errors:
It is defined by (estimation of $y$):
## $MSE \equiv \frac{1}{n} \sum_i (y_i - \hat{y}_i)^2$
## Coefficient of determination (R$^2$)
It is the proportion of the variance in the dependent variable that is predictable from the independent variable(s).
It is defined as:
## $R^2 \equiv 1 - \frac{SS_{res}}{SS_{tot}}$,
where
### $ SS_{res} = \sum_i (y_i - \hat{y}_i)^2$
and
### $ SS_{tot} = \sum_i (y_i - \bar{y})^2$
## Variance and bias
The **variance** of an estimator of the parameter $\theta$ will be:
## $Var_{\hat{\theta}} = E_{\hat{\theta}}\biggl[ \bigl(\hat{\theta} - E_{\hat{\theta}}[\hat{\theta}]\bigr)^2\biggr]$
The **bias** of an estimator will be:
## $Bias_{\hat{\theta}} = E_{\hat{\theta}} - \theta$
## Relation between MSE, variance and bias
Note that when estimating a parameter the MSE equals the variance plus the bias squared
# Linear regression
The one dimensional linear regression model is defined by
$f(x, \theta) = \theta_0 + \theta_1 x$
## Least squares regression for linear regression
## 1. Ordinary least squares
Minimizes the residual sum of squares (RSS) between the observed response values $y_i$ and the model predictions
### $\min RSS = \min \sum\limits_{i=1}^{n} (y_i - \theta_0 - \theta_1 x_i)^2$
Differentiating w.r.t. to $\theta_0$ and $\theta_1$ and setting these derivatives to zero gives two equations which can be solved to give:
## $\hat{\theta}_{1, OLS} = \frac{\sum\limits_{i=1}^n (x_i - \bar{x}) (y_i - \bar{y})}{\sum\limits_{i=1}^n (x_i - \bar{x})^2} = \frac{S_{xy}}{S_{xx}}$
## $\hat{\theta}_{0, OLS} = \bar{y} - \hat{\theta}_{1,OLS} ~\bar{x}$
OLS = ordinary least squares
These estimators are also the maximum likelihood estimator (MLE) when the errors are normally distributed.
The OLS estimator of the error variance $\sigma^2$ is:
## $\hat{\sigma}^2 = S^2 = \frac{RSS}{n - 2}$
If the errors are i.i.d. random variables, the slope and intercept are unbiased and asymptotically normally distributed:
## $\hat{\theta}_{1, OLS} \sim N\biggl(\theta_1, \frac{\sigma^2}{S_{XX}}\biggr)$
## $\hat{\theta}_{0, OLS} \sim N\biggl(\theta_0, \sigma^2 \biggl(\frac{1}{n} + \frac{\bar{x}^2}{S_{XX}}\biggr)\biggr)$
If the errors are also normally distributed with zero mean and known variance $\sigma^2$, then the variance is $\chi^2$ distributed:
## $\hat{\sigma}^2 \sim \biggl(\frac{\sigma^2}{n - 2} \biggr) \chi_{n-2}^{2}$
However, $\sigma^2$ is rarely known, and only the sample variance $S^2$ is known, changing the statistical properties of the estimators.
Defining:
## $ T = \frac{\hat{\theta_1} - \theta_1}{SE}$
where $SE = \frac{S}{\sqrt{S_{XX}}}$ is also known as the **standard error**,
one can show that $T$ is t (t-Student) distributed with $n-2$ degrees of freedom.
Then, the $(1-\alpha)$ confidence interval for $\theta_1$ becomes $(\hat{\theta}_1 - t_{\alpha/2, n-2} ~ SE, \hat{\theta}_1 + t_{\alpha/2, n-2} ~ SE)$ and the confidence interval for $y$ at a given $x$ becomes:
## $y(x) = \hat{\theta}_0 + \hat{\theta}_1 x \pm t_{\alpha/2, n - 2} ~ S ~ \sqrt{1 + \frac{1}{n} \frac{(x - \bar{x})^2}{S_{xx}}}$
## 2. Maximum likelihood estimator (MLE)
Let us consider the probability of observing $\lbrace y_i \rbrace$ given the parameters $\theta$ and the set of independent variable $\lbrace x_i \rbrace$.
Here we assume that the observations are Gaussian with standard deviation $\sigma_i$:
## $p(\lbrace y_i \rbrace | \lbrace x_i \rbrace, \theta) = \prod\limits_{i = 1}^{N} \frac{1}{\sqrt{2 \pi} \sigma_i} \exp \biggl( \frac{- (y_i - (\theta_0 + \theta_1 x_i))^2}{2 \sigma_i^2} \biggr)$
Thus, we can maximize the log likelihood minus a constant to find the **maximum likelihood estimator (MLE)**
## $\log(L) = \log p(\lbrace y_i \rbrace | \lbrace x_i \rbrace, \theta) = \sum\limits_{i = 1}^{N} \bigl( \frac{- (y_i - (\theta_0 + \theta_1 x_i))^2}{2 \sigma_i^2} \bigr)$
which is **equivalent to minimizing the RSS**
Using Bayes theorem $P(A|B) = P(B|A)~\dfrac{P(A)}{P(B)}$ we can also see that
## $P(\theta | \lbrace y_i \rbrace, \lbrace x_i \rbrace) = P(\lbrace y_i \rbrace | \lbrace x_i \rbrace, \theta) ~ \frac{p(\theta)}{p(y_i)}$
Therefore, this is also the **maximum a posteriori (MAP)** estimator assuming a flat prior for $\theta$.
## Online estimation
This figure illustrates how the uncertainties in the parameters shrink as the number of observations grow.
### Diabetes dataset example
(https://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html#sphx-glr-auto-examples-linear-model-plot-ols-py)
We want to try and figure out how bmi affects how sick the person is after one year.
```python
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
# Load the diabetes dataset
diabetes = datasets.load_diabetes()
print(diabetes.DESCR)
```
.. _diabetes_dataset:
Diabetes dataset
----------------
Ten baseline variables, age, sex, body mass index, average blood
pressure, and six blood serum measurements were obtained for each of n =
442 diabetes patients, as well as the response of interest, a
quantitative measure of disease progression one year after baseline.
**Data Set Characteristics:**
:Number of Instances: 442
:Number of Attributes: First 10 columns are numeric predictive values
:Target: Column 11 is a quantitative measure of disease progression one year after baseline
:Attribute Information:
- age age in years
- sex
- bmi body mass index
- bp average blood pressure
- s1 tc, total serum cholesterol
- s2 ldl, low-density lipoproteins
- s3 hdl, high-density lipoproteins
- s4 tch, total cholesterol / HDL
- s5 ltg, possibly log of serum triglycerides level
- s6 glu, blood sugar level
Note: Each of these 10 feature variables have been mean centered and scaled by the standard deviation times `n_samples` (i.e. the sum of squares of each column totals 1).
Source URL:
https://www4.stat.ncsu.edu/~boos/var.select/diabetes.html
For more information see:
Bradley Efron, Trevor Hastie, Iain Johnstone and Robert Tibshirani (2004) "Least Angle Regression," Annals of Statistics (with discussion), 407-499.
(https://web.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf)
```python
# Use only one feature (body mass index)
diabetes_X = diabetes.data[:, np.newaxis, 2] # axis 2 = bmi
# Split the data into training/testing sets
diabetes_X_train = diabetes_X[:-20] # last 20 points
diabetes_X_test = diabetes_X[-20:] # we put them into the test set
# Split the targets into training/testing sets accordingly
diabetes_y_train = diabetes.target[:-20]
diabetes_y_test = diabetes.target[-20:]
# Create linear regression object
regr = linear_model.LinearRegression()
# Train the model using the training sets
regr.fit(diabetes_X_train, diabetes_y_train)
# Make predictions using the testing set
diabetes_y_pred = regr.predict(diabetes_X_test)
# The coefficients
print('Coefficients: \n', regr.coef_)
# The mean squared error
print("Mean squared error (MSE): %.2f"
% mean_squared_error(diabetes_y_test, diabetes_y_pred))
# Explained variance score: 1 is perfect prediction
print('Variance score (coefficient of determination, R2): %.2f' % r2_score(diabetes_y_test, diabetes_y_pred))
```
Coefficients:
[938.23786125]
Mean squared error (MSE): 2548.07
Variance score (coefficient of determination, R2): 0.47
```python
fig, ax = plt.subplots(figsize = (11, 7))
ax.scatter(diabetes_X_test, diabetes_y_test, c='k')
ax.scatter(diabetes_X_train, diabetes_y_train, c='gray', alpha=0.3)
ax.plot(diabetes_X_test, diabetes_y_pred, color=blue, linewidth=3)
ax.set_xlabel("BMI (scaled)")
ax.set_ylabel("Diabetes disease progression")
```
## 3. Least squares in matrix form
The previous equations can be derived in matrix form
In general one can define regression in terms of a design matrix $M$:
## $y = {\bf M} ~ \theta$
where $y$ is the $N$βdimensional vector of values $y_i$.
## $y = \begin{bmatrix} y_0 \\ y_1 \\ . \\ y_{N-1} \end{bmatrix}$
For straight--line regression, $\theta$ is a two--dimensional vector:
## $\theta = \begin{bmatrix} \theta_0 \\ \theta_1 \end{bmatrix}$
and $M$ is a $2 \times N$ matrix:
## ${\bf M} = \begin{bmatrix} 1 & x_0 \\ 1 & x_1 \\ ... & ... \\ 1 & x_{N-1} \\ \end{bmatrix}$
For the case of heteroscedastic (different) uncertainties, we can define the covariance matrix $C$:
## $ C = \begin{bmatrix} \sigma_0^2 & 0 & . & 0 \\ 0 & \sigma_1^2 & . & 0 \\ . & . & . & . \\ 0 & 0 & . & \sigma_{N - 1}^2\\ \end{bmatrix}$
The MLE solution for this regression is:
## ${\bf \hat{\theta}} = ({\bf M}^T C^{-1} {\bf M})^{-1} ({\bf M}^T C^{-1} {\bf y})$
which is the also the solution that minimizes the equation
## $({\bf y} - {\bf M} ~ \theta)^{-1} C^{-1} ({\bf y} - {\bf M} ~ \theta)$
The uncertainties on the regression coefficients $\bf \theta$ can be expressed as the following matrix (general case):
## $\Sigma_\theta = \begin{bmatrix} \sigma_{\theta_0}^2 & \dots & \sigma_{\theta_0 \theta_i} & \dots \\ \vdots & \ddots & \vdots & \vdots \\ \sigma_{\theta_0 \theta_i} & \dots & \sigma_{\theta_i}^2 \\ \vdots & \vdots & \vdots & \ddots \\ \end{bmatrix} = [{\bf M}^T C^{-1} {\bf M}]^{-1}$
Values outside of the diagonal appear when they are not fully independent.
In the general case, $C$ can be non--diagonal too, which indicates correlated noise.
We can extend it to...
## 4. Polynomial regression
Let us consider the case where we perform a polynomial representation of the data, e.g.:
## $y_i = \theta_0 + \theta_1 x_i + \theta_2 x_i^2 + \theta_3 x_i^3$
In this case the design matrix $M$ becomes:
## $ M = \begin{bmatrix}
1 & x_0 & x_0^2 & x_0^3 \\
1 & x_1 & x_1^2 & x_1^3 \\
. & . & . & . \\
1 & x_N & x_N^2 & x_N^3 \\
\end{bmatrix}$
And the previous formulae can be used to find the least squares solution since the coefficients are linear
# Regularization
Sometimes we may want to trade an increase in bias for a reduction in variance (e.g. if the matrix $M$ is ill-conditioned the variance could be very large)
## 1. Ridge regression
In this case we include the following regularization term in the least squares equation:
## $({\bf y} - M~ \theta)^{-1} C^{-1}({\bf y} - M~ \theta) + \lambda~ |\theta^T \theta|$
$\lambda$ is called the **regularization or smoothing parameter** and **$|\theta^T \theta|$** is called the **penalty function**
It can be shown that the new solution will be:
## ${\bf \hat{\theta}} = ({\bf M}^T C^{-1} {\bf M} + \lambda I)^{-1} ({\bf M}^T C^{-1} {\bf y})$
It is worth noting that even if $M^T C^{-1} M$ were singular, $M^T C^{-1} M + \lambda I$ may not be singular
=> $\lambda$ wants $\theta$ to have elements with less variance
"Continuous"
### Bayes equivalent
In the Bayesian approach, it can be shown that the MAP solution is the same as the ridge solution if we assume a Gaussian prior for the parameters $\theta$:
## $ p(\theta) \propto \exp \biggl( \frac{- \lambda (\theta^T \theta)}{2} \biggr)$
Ridge regression effectively constrains the norm of the parameters $\theta$:
## $|{\bf \theta}|^2 < s$
## 2. LASSO regression
Another common regularization technique
In this case we include a different regularization term in the least squares equation:
## $({\bf y} - \theta {\bf X})^{-1}({\bf y} - \theta {\bf X}) + \lambda |\theta|$
Now we use the $\ell_1$ norm instead of the $\ell_2$ norm.
In this case there is no closed form, but it can be shown that the MAP solution is the same if an exponential prior for the parameters $\theta$ is assumed.
LASSO regression effectively constrains the $\ell_1$ norm of the parameters $\theta$:
## $|{\bf \theta}| < s$
=> $\lambda$ wants $\theta$ to have less elements
"Discrete"
### Understanding Ridge and LASSO regression
# Comparison between ordinary, Ridge and LASSO regression
```python
from sklearn import linear_model
X_train = np.c_[.5, 1].T
y_train = [.5, 1]
X_test = np.c_[0, 2].T
np.random.seed(0)
classifiers = dict(ols=linear_model.LinearRegression(),
ridge=linear_model.Ridge(alpha=.05),
lasso=linear_model.Lasso(alpha=.02))
for name, clf in classifiers.items():
fig, ax = plt.subplots(figsize=(4, 3))
for _ in range(6):
this_X = .1 * np.random.normal(size=(2, 1)) + X_train
clf.fit(this_X, y_train)
ax.plot(X_test, clf.predict(X_test), color='gray')
ax.scatter(this_X, y_train, s=3, c='gray', marker='o', zorder=10)
clf.fit(X_train, y_train)
ax.plot(X_test, clf.predict(X_test), linewidth=2, color=blue)
ax.scatter(X_train, y_train, s=30, c=red, marker='+', zorder=10)
ax.set_title(name)
ax.set_xlim(0, 2)
ax.set_ylim((0, 1.6))
ax.set_xlabel('X')
ax.set_ylabel('y')
fig.tight_layout()
plt.show()
```
## Choosing the regularization parameter $\lambda$
One way to choose $\lambda$ is to do k-fold cross-validation on $\lambda$, defining the error:
## $ Err(\lambda) = k^{1} \sum_k N_k^{-1} \sum\limits_{i}^{N_k} \frac{[y_i - f(x_i | \theta)]^2}{\sigma_i^2}$
and then choose the $\lambda$ with the smallest error.
# Outliers
## Huber loss
The Huber estimator minimizes
### $ \sum\limits_{i=1}^N e(y_i|y)$
where $e(y_i|y)$ is modeled as:
### $\begin{equation}
\phi(t)=\left\{
\begin{array}{@{}ll@{}}
\frac{1}{2} t^2, & \text{if}\ |t|\le c \\
c|t| - \frac{1}{2} c^2, & \text{otherwise}
\end{array}\right.
\end{equation}$
With $t = y_i - \hat{y}_i$
c is a new parameter
If it's close to the line, it is treated as a Gaussian. If it is far, as an exponencial.
## Bayesian Outlier Methods
Alternative to the Huber loss, we can modify the likelihood function by assuming a mixture model, where some points belong to an outlier distribution, which is modeled as a Gaussian with mean $\mu_b$ and variance $V_b$, and others belong to the main population, which follow the linear model.
1. Assume that the probability of belonging to the outlier population is $p_b$
2. Assume that each point can be tagged as either outlier ($g_i = 0$) or not ($g_i = 1$)
```python
```
```python
from sklearn.datasets import make_regression
from sklearn.linear_model import HuberRegressor, Ridge
# Generate toy data.
rng = np.random.RandomState(0)
X, y = make_regression(n_samples=20, n_features=1, random_state=0, noise=4.0,
bias=100.0)
# Add four strong outliers to the dataset.
X_outliers = rng.normal(0, 0.5, size=(4, 1))
y_outliers = rng.normal(0, 2.0, size=4)
X_outliers[:2, :] += X.max() + X.mean() / 4.
X_outliers[2:, :] += X.min() - X.mean() / 4.
y_outliers[:2] += y.min() - y.mean() / 4.
y_outliers[2:] += y.max() + y.mean() / 4.
X = np.vstack((X, X_outliers))
y = np.concatenate((y, y_outliers))
plt.plot(X, y, 'b.')
# Fit the huber regressor over a series of epsilon values.
colors = ['r-', 'b-', 'y-', 'm-']
x = np.linspace(X.min(), X.max(), 7)
epsilon_values = [1.35, 1.5, 1.75, 1.9]
for k, epsilon in enumerate(epsilon_values):
huber = HuberRegressor(fit_intercept=True, alpha=0.0, max_iter=100,
epsilon=epsilon)
huber.fit(X, y)
coef_ = huber.coef_ * x + huber.intercept_
plt.plot(x, coef_, colors[k], label="huber loss, %s" % epsilon)
# Fit a ridge regressor to compare it to huber regressor.
ridge = Ridge(fit_intercept=True, alpha=0.0, random_state=0, normalize=True)
ridge.fit(X, y)
coef_ridge = ridge.coef_
coef_ = ridge.coef_ * x + ridge.intercept_
plt.plot(x, coef_, 'g-', label="ridge regression")
plt.title("Comparison of HuberRegressor vs Ridge")
plt.xlabel("X")
plt.ylabel("y")
plt.legend(loc=0)
plt.show()
```
# Cross-Validation Testing
Analogous to the classification problem, one can also do cross-validation during regression to determine the best hyperparameters. For example, choosing the regularization parameter for ridge or lasso regression, or choosing the polynomial degree of a polynomial fit.
=> **how to know when to stop increasing the degree of the polynomial?**
We want to get close to the data points, but not EXACTLY. We want the underlying distribution, not get this specific set.
We want to be somewhere in the good range that makes it better for both sets.
```python
```
|
module FreeRTOS.Task.Utils
import FreeRTOS.Task.Control
%default total
%include C "FreeRTOS.h"
%include C "task.h"
||| The handle of the currently running (calling) task.
getCurrentTaskTID : IO TID
getCurrentTaskTID = do
ptr <- foreign FFI_C "xTaskGetCurrentTaskHandle" (IO Ptr)
pure (MkTID ptr)
||| The task handle associated with the Idle task.
getIdleTaskHandle : IO TID
getIdleTaskHandle = do
ptr <- foreign FFI_C "xTaskGetIdleTaskHandle" (IO Ptr)
pure (MkTID ptr)
||| Looks up the name of a task from the taskβs handle.
getName : TID -> IO String
getName (MkTID ptr) =
foreign FFI_C "pcTaskGetName" (Ptr -> IO String) ptr
||| The number of tasks that the RTOS kernel is currently managing.
getNbrTasks : IO Int
getNbrTasks =
foreign FFI_C "uxTaskGetNumberOfTasks" (IO Int)
|
import Criterion.Main
import Criterion.Types
import Dimacs (parseDIMACSFromFile)
import Internal.Sat (solveDIMACS)
import Sat (solve)
import Statistics.Types
import Test.HUnit
solveFile :: String -> Bool -> IO ()
solveFile fileName isSat = do
parsed <- parseDIMACSFromFile ("resources/problems/" ++ fileName)
case parsed of
Right dimacs -> do
case solveDIMACS dimacs of
Just _ -> assertBool "" isSat
Nothing -> assertBool "" (not isSat)
return ()
left -> assertFailure $ "" ++ fileName ++ "cannot be parsed"
main :: IO ()
main =
Criterion.Main.defaultMainWith
(defaultConfig {timeLimit = 30})
[ bgroup
"sat tests"
[ benchit "add4.cnf" False,
benchit "diamond1.cnf" False,
benchit "diamond2.cnf" False,
benchit "diamond3.cnf" False,
benchit "ph2.cnf" False,
benchit "ph3.cnf" False,
benchit "prime4.cnf" True,
benchit "prime9.cnf" True,
benchit "prime25.cnf" True,
benchit "prime49.cnf" True,
benchit "prime121.cnf" True
]
]
where
benchit fileName isSat = bench fileName $ whnfIO $ solveFile fileName isSat
|
[STATEMENT]
lemma ab_obey_2[PLM]:
"[(\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr>) \<^bold>\<rightarrow> ((\<^bold>\<exists> F . \<lbrace>x\<^sup>P, F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P, F\<rbrace>) \<^bold>\<rightarrow> x\<^sup>P \<^bold>\<noteq> y\<^sup>P) in v]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. [\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> \<^bold>\<rightarrow> ((\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace>) \<^bold>\<rightarrow> x\<^sup>P \<^bold>\<noteq> y\<^sup>P) in v]
[PROOF STEP]
proof(rule CP; rule CP)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
assume abs_xy: "[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]"
[PROOF STATE]
proof (state)
this:
[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
assume "[\<^bold>\<exists> F . \<lbrace>x\<^sup>P, F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P, F\<rbrace> in v]"
[PROOF STATE]
proof (state)
this:
[\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]
[PROOF STEP]
obtain P where P_prop:
"[\<lbrace>x\<^sup>P, P\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P, P\<rbrace> in v]"
[PROOF STATE]
proof (prove)
using this:
[\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]
goal (1 subgoal):
1. (\<And>P. [\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,P\<rbrace> in v] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule "\<^bold>\<exists>E")
[PROOF STATE]
proof (state)
this:
[\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
[\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
assume "[x\<^sup>P \<^bold>= y\<^sup>P in v]"
[PROOF STATE]
proof (state)
this:
[x\<^sup>P \<^bold>= y\<^sup>P in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
hence "[\<lbrace>x\<^sup>P, P\<rbrace> \<^bold>\<equiv> \<lbrace>y\<^sup>P, P\<rbrace> in v]"
[PROOF STATE]
proof (prove)
using this:
[x\<^sup>P \<^bold>= y\<^sup>P in v]
goal (1 subgoal):
1. [\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>\<equiv> \<lbrace>y\<^sup>P,P\<rbrace> in v]
[PROOF STEP]
using l_identity[axiom_instance, deduction, deduction]
oth_class_taut_4_a
[PROOF STATE]
proof (prove)
using this:
[x\<^sup>P \<^bold>= y\<^sup>P in v]
\<lbrakk>[?\<alpha>3 \<^bold>= ?\<beta>3 in ?v]; [?\<phi>3 ?\<alpha>3 in ?v]\<rbrakk> \<Longrightarrow> [?\<phi>3 ?\<beta>3 in ?v]
[?\<phi> \<^bold>\<equiv> ?\<phi> in ?v]
goal (1 subgoal):
1. [\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>\<equiv> \<lbrace>y\<^sup>P,P\<rbrace> in v]
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
[\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>\<equiv> \<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
hence "[\<lbrace>y\<^sup>P, P\<rbrace> in v]"
[PROOF STATE]
proof (prove)
using this:
[\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>\<equiv> \<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. [\<lbrace>y\<^sup>P,P\<rbrace> in v]
[PROOF STEP]
using P_prop[conj1]
[PROOF STATE]
proof (prove)
using this:
[\<lbrace>x\<^sup>P,P\<rbrace> \<^bold>\<equiv> \<lbrace>y\<^sup>P,P\<rbrace> in v]
[\<lbrace>x\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. [\<lbrace>y\<^sup>P,P\<rbrace> in v]
[PROOF STEP]
by (rule "\<^bold>\<equiv>E")
[PROOF STATE]
proof (state)
this:
[\<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
[x\<^sup>P \<^bold>= y\<^sup>P in v] \<Longrightarrow> [\<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. \<lbrakk>[\<lparr>A!,x\<^sup>P\<rparr> \<^bold>& \<lparr>A!,y\<^sup>P\<rparr> in v]; [\<^bold>\<exists>F. \<lbrace>x\<^sup>P,F\<rbrace> \<^bold>& \<^bold>\<not>\<lbrace>y\<^sup>P,F\<rbrace> in v]\<rbrakk> \<Longrightarrow> [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
thus "[x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]"
[PROOF STATE]
proof (prove)
using this:
[x\<^sup>P \<^bold>= y\<^sup>P in v] \<Longrightarrow> [\<lbrace>y\<^sup>P,P\<rbrace> in v]
goal (1 subgoal):
1. [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
using P_prop[conj2] modus_tollens_1 CP
[PROOF STATE]
proof (prove)
using this:
[x\<^sup>P \<^bold>= y\<^sup>P in v] \<Longrightarrow> [\<lbrace>y\<^sup>P,P\<rbrace> in v]
[\<^bold>\<not>\<lbrace>y\<^sup>P,P\<rbrace> in v]
\<lbrakk>[?\<phi> \<^bold>\<rightarrow> ?\<psi> in ?v]; [\<^bold>\<not>?\<psi> in ?v]\<rbrakk> \<Longrightarrow> [\<^bold>\<not>?\<phi> in ?v]
([?\<phi> in ?v] \<Longrightarrow> [?\<psi> in ?v]) \<Longrightarrow> [?\<phi> \<^bold>\<rightarrow> ?\<psi> in ?v]
goal (1 subgoal):
1. [x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[x\<^sup>P \<^bold>\<noteq> y\<^sup>P in v]
goal:
No subgoals!
[PROOF STEP]
qed |
module overlap_backend
implicit none
double precision, parameter :: zero = 0.0d0
double precision, parameter :: half = 0.5d0
double precision, parameter :: one = 1.0d0
double precision, parameter :: two = 2.0d0
! Use this constant instead of global, because of compatibility with MNDO etc
double precision, parameter :: AU_TO_EV = 27.21d0
! contains the factorials of i-1
double precision, parameter :: fc(1:25) =&
(/ 1.0d0,1.0d0, 2.0d0, 6.0d0, 24.0d0, &
120.0d0, 720.0d0, 5040.0d0, 40320.0d0, 362880.0d0, &
3628800.0d0, 39916800.0d0, 4.790016d+08, 6.2270208d+09, 8.71782912d+10, &
1.307674368d+12, 2.092278989d+13, 3.55687428096d+14, 6.402373705728d+15, 1.21645100408832d+17, &
2.43290200817664d+18, 5.109094217170944d+19, 1.12400072777760768d+21, 2.585201673888497664d+22, &
6.2044840173323943936d+23 /)
double precision, parameter :: logfc(1:25) = (/ 0.0d0, 0.0d0, 0.6931471805599d0, &
& 1.7917594692281d0, 3.1780538303479d0, 4.7874917427820d0, &
& 6.5792512120101d0, 8.5251613610654d0, 10.6046029027453d0, &
& 12.8018274800815d0, 15.1044125730755d0, 17.5023078458739d0, &
& 19.9872144956619d0, 22.5521638531234d0, 25.1912211827387d0, &
& 27.8992713838409d0, 30.6718601061763d0, 33.5050734501369d0, &
& 36.3954452080331d0, 39.3398841871995d0, 42.3356164607535d0, &
& 45.3801388984769d0, 48.4711813518352d0, 51.6066755677644d0, &
& 54.7847293981123d0 /)
! define c coefficients for associate legendre polynomials.
double precision, parameter::cc(1:21,1:3) = reshape ( (/ &
8.0d0, 8.0d0, 4.0d0, -4.0d0, 4.0d0, &
4.0d0, -12.0d0, -6.0d0, 20.0d0, 5.0d0, &
3.0d0, -30.0d0, -10.0d0, 35.0d0, 7.0d0, &
15.0d0, 7.5d0, -70.0d0, -17.5d0, 63.0d0, &
10.5d0, &
0.0d0, 0.0d0, 0.0d0, 12.0d0, 0.0d0, &
0.0d0, 20.0d0, 30.0d0, 0.0d0, 0.0d0, &
-30.0d0, 70.0d0, 70.0d0, 0.0d0, 0.0d0, &
-70.0d0, -105.d0, 210.0d0, 157.5d0, 0.0d0, &
0.0d0, &
0.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, &
0.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, &
35.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, &
63.0d0, 157.5d0, 0.0d0, 0.0d0, 0.0d0, &
0.0d0/), (/ 21, 3 /) )
double precision, save::A(15),B(15)
! Constants
! THE ARRAY B0(I) CONTAINS THE B INTEGRALS FOR ZERO ARGUMENT.
double precision, parameter :: B0(1:15)= &
& (/ 2.0D0,0.0D0,0.666666666666667D0,0.0D0,0.4D0,0.0D0, &
& 0.285714285714286D0,0.0D0,0.222222222222222D0,0.0D0, &
& 0.181818181818182D0,0.0D0,0.153846153846154D0,0.0D0, &
& 0.133333333333333D0 /)
! define addresses for index pairs (00,10,20,30,40,50,60,70).
integer,parameter:: iad(1:8)= (/ 1,2,4,7,11,16,22,29 /)
! define binomial coefficients (00,10,11,20,...,77).
integer,parameter:: ibinom(1:36)= (/&
& 1,1,1,1,2,1,1,3,3,1,1,4,6,4,1,1,5,10,10,5,1, &
& 1,6,15,20,15,6,1,1,7,21,35,35,21,7,1 /)
contains
function binomialcoefficient(m, n) result (biocoeff)
integer, intent(in)::m,n
double precision::biocoeff
integer, parameter::size=30
integer, save::bc(size,size)=0
logical, save::initialized=.false.;
integer::i,j,k
if (.not.initialized) then
do i=1,size
bc(i,1)=one
bc(i,2:size)=zero
end do
do i=2, size
do j=2, i
bc(i,j)=bc(i-1,j-1)+bc(i-1,j)
end do
end do
initialized=.true.
end if
biocoeff=one*bc(m,n)
end function binomialcoefficient
function getslateroverlap(na, la, nb, lb, mm, zeta_a, zeta_b, rab) result (overlap)
implicit none
integer, intent(in)::na, la, nb, lb, mm
double precision, intent(in)::zeta_a,zeta_b, rab
double precision::overlap
! local variables
integer, save::ntotal=-1
double precision, save:: zeta_a_old=-1.0d99, zeta_b_old=-1.0d99
double precision, save:: rab_old=-1.0d99
double precision, parameter:: tolerance=1.d0-16
logical::resetup
if ((la.ge.na) .or. (lb.ge.nb)) then
overlap=0.d0
return
end if
resetup=.true.
if (ntotal.eq. (na+nb)) then
if (abs(rab_old/rab-1.d0)< tolerance) then
if (abs(zeta_a_old/zeta_a-1.d0) < tolerance) then
if (abs(zeta_b_old/zeta_b-1.d0) < tolerance) then
resetup=.false.
end if
end if
end if
end if
if (resetup) then
ntotal=(na+nb)
rab_old=rab
zeta_a_old=zeta_a
zeta_b_old=zeta_b
call setupslaterauxiliary(ntotal, zeta_a, zeta_b, rab)
end if
overlap=calculateoverlap (na,la,mm,nb,lb,zeta_a*rab,zeta_b*rab)
end function getslateroverlap
subroutine setupslaterauxiliary(n,sa,sb,rab)
! *
! calculation of auxiliary integrals for sto overlaps.
! *
implicit double precision (a-h,o-z)
implicit integer (i-n)
!explicit type to satisfy pgi v8 compiler
double precision betpow(17)
! *** initialization.
alpha = 0.5d0*rab*(sa+sb)
beta = 0.5d0*rab*(sa-sb)
! *** auxiliary a integrals for calculation of overlaps.
c = exp(-alpha)
ralpha = 1.0d0/alpha
a(1) = c*ralpha
do i=1,n
a(i+1) = (a(i)*i+c)*ralpha
end do
! *** auxiliary b integrals for calculation of overlaps.
! the code is valid only for n.le.14, i.e. for overlaps
! involving orbitals with main quantum numbers up to 7.
! branching depending on absolute value of the argument.
absx = abs(beta)
! zero argument.
if(absx.lt.1.0d-06) then
do i=1,n+1
b(i) = b0(i)
enddo
return
endif
! large argument.
if((absx.gt.0.5d0 .and. n.le.5) .or. &
& (absx.gt.1.0d0 .and. n.le.7) .or. &
& (absx.gt.2.0d0 .and. n.le.10).or. &
& absx.gt.3.0d0) then
expx = exp(beta)
expmx = 1.0d0/expx
rx = 1.0d0/beta
b(1) = (expx-expmx)*rx
do i=1,n
expx = -expx
b(i+1)= (i*b(i)+expx-expmx)*rx
enddo
return
endif
! small argument.
if(absx.le.0.5d0) then
last = 6
else if(absx.le.1.0d0) then
last = 7
else if(absx.le.2.0d0) then
last = 12
else
last = 15
endif
betpow(1) = 1.0d0
do m=1,last
betpow(m+1) = -beta*betpow(m)
enddo
do i=1,n+1
y = 0.0d0
ma = 1-mod(i,2)
do m=ma,last,2
y = y+betpow(m+1)/(fc(m+1)*(m+i))
enddo
b(i) = y*2.0d0
enddo
return
end subroutine setupslaterauxiliary
function calculateoverlap (na,la,mm,nb,lb,alpha,beta)
! *
! overlap integrals between slater type orbitals.
! *
! quantum numbers (na,la,mm) and (nb,lb,mm).
! na and nb must be positive and less than or equal to 7.
! la, lb and abs(mm) must be less than or equal to 5.
! further restrictions are la.le.na, lb.le.nb,
! mm.le.la, and mm.le.lb.
! *
implicit double precision (a-h,o-z)
implicit integer (i-n)
! *** initialization.
m = abs(mm)
nab = na+nb+1
x = 0.0d0
! *** find a and b integrals.
! p = (alpha + beta)*0.5
! pt = (alpha - beta)*0.5
! call aintgs(a,p,na+nb)
! call bintgs(b,pt,na+nb)
! *** section used for overlap integrals involving s functions.
if((la.gt.0).or.(lb.gt.0)) go to 20
iada = iad(na+1)
iadb = iad(nb+1)
do 10 i=0,na
iba = ibinom(iada+i)
do 10 j=0,nb
ibb = iba*ibinom(iadb+j)
if(mod(j,2).eq.1) ibb=-ibb
ij = i+j
x = x+ibb*a(nab-ij)*b(ij+1)
10 continue
ss = x * 0.5d0
ss = ss * sqrt( alpha**(2*na+1)*beta**(2*nb+1)/ &
& (fc(2*na+1)*fc(2*nb+1)) )
calculateoverlap = ss
return
! *** section used for overlap integrals involving p functions.
! *** special case m=0, s-p(sigma), p(sigma)-s, p(sigma)-p(sigma).
20 if(la.gt.1 .or. lb.gt.1) go to 320
if(m.gt.0) go to 220
iu = mod(la,2)
iv = mod(lb,2)
namu = na-iu
nbmv = nb-iv
iadna = iad(namu+1)
iadnb = iad(nbmv+1)
do 130 kc=0,iu
ic = nab-iu-iv+kc
jc = 1+kc
do 130 kd=0,iv
id = ic+kd
jd = jc+kd
do 130 ke=0,namu
ibe = ibinom(iadna+ke)
ie = id-ke
je = jd+ke
do 130 kf=0,nbmv
ibf = ibe*ibinom(iadnb+kf)
if(mod(kd+kf,2).eq.1) ibf=-ibf
x = x+ibf*a(ie-kf)*b(je+kf)
130 continue
ss = x * sqrt( (2*la+1)*(2*lb+1)*0.25d0 )
! compute overlap integral from reduced overlap integral.
ss = ss * sqrt( alpha**(2*na+1)*beta**(2*nb+1)/ &
& (fc(2*na+1)*fc(2*nb+1)) )
if(mod(lb,2).eq.1) ss=-ss
calculateoverlap = ss
return
! *** section used for overlap integrals involving p functions.
! *** special case la=lb=m=1, p(pi)-p(pi).
220 iadna = iad(na)
iadnb = iad(nb)
do 230 ke=0,na-1
ibe = ibinom(iadna+ke)
ie = nab-ke
je = ke+1
do 230 kf=0,nb-1
ibf = ibe*ibinom(iadnb+kf)
if(mod(kf,2).eq.1) ibf=-ibf
i = ie-kf
j = je+kf
x = x+ibf*(a(i)*b(j)-a(i)*b(j+2)-a(i-2)*b(j)+a(i-2)*b(j+2))
230 continue
ss = x * 0.75d0
! compute overlap integral from reduced overlap integral.
ss = ss * sqrt( alpha**(2*na+1)*beta**(2*nb+1)/ &
& (fc(2*na+1)*fc(2*nb+1)) )
if(mod(lb+mm,2).eq.1) ss=-ss
calculateoverlap = ss
return
! *** section used for overlap integrals involving non-s functions.
! *** general case la.gt.1 or lb.gt.1, m.ge.0.
320 lam = la-m
lbm = lb-m
iada = iad(la+1)+m
iadb = iad(lb+1)+m
iadm = iad(m+1)
iu1 = mod(lam,2)
iv1 = mod(lbm,2)
iuc = 0
do 340 iu=iu1,lam,2
iuc = iuc+1
cu = cc(iada,iuc)
namu = na-m-iu
iadna = iad(namu+1)
iadu = iad(iu+1)
ivc = 0
do 340 iv=iv1,lbm,2
ivc = ivc+1
nbmv = nb-m-iv
iadnb = iad(nbmv+1)
iadv = iad(iv+1)
sum = 0.0d0
do 330 kc=0,iu
ibc = ibinom(iadu+kc)
ic = nab-iu-iv+kc
jc = 1+kc
do 330 kd=0,iv
ibd = ibc*ibinom(iadv+kd)
id = ic+kd
jd = jc+kd
do 330 ke=0,namu
ibe = ibd*ibinom(iadna+ke)
ie = id-ke
je = jd+ke
do 330 kf=0,nbmv
ibf = ibe*ibinom(iadnb+kf)
iff = ie-kf
jff = je+kf
do 330 ka=0,m
iba = ibf*ibinom(iadm+ka)
i = iff-2*ka
do 330 kb=0,m
ibb = iba*ibinom(iadm+kb)
if(mod(ka+kb+kd+kf,2).eq.1) ibb=-ibb
j = jff+2*kb
sum = sum+ibb*a(i)*b(j)
330 continue
x = x+sum*cu*cc(iadb,ivc)
340 continue
ss = x*(fc(m+2)/8.0d0)**2* sqrt( (2*la+1)*fc(la-m+1)* &
& (2*lb+1)*fc(lb-m+1)/(4.0d0*fc(la+m+1)*fc(lb+m+1)))
! compute overlap integral from reduced overlap integral.
ss = ss * sqrt( alpha**(2*na+1)*beta**(2*nb+1)/ &
& (fc(2*na+1)*fc(2*nb+1)) )
if(mod(lb+mm,2).eq.1) ss=-ss
calculateoverlap = ss
return
end function calculateoverlap
! Calculate the radial part of one-center two-electron integrals (slater-condon parameter).
function getslatercondonparameter(k,na,ea,nb,eb,nc,ec,nd,ed) result(slatercondon)
! Type of integral, can be equal to 0,1,2,3,4 in spd-basis
integer, intent(in) :: k
! Principle quantum number of ao, electron 1
integer, intent(in) :: na
integer, intent(in) :: nb
! Principle quantum number of ao, electron 2
integer, intent(in) :: nc
integer, intent(in) :: nd
! Exponents of ao, electron 1
double precision, intent(in) :: ea
double precision, intent(in) :: eb
! Exponents of ao, electron 2
double precision, intent(in) :: ec
double precision, intent(in) :: ed
! The resulting Slater-Condon parameter
double precision :: slatercondon
! Local variables
integer :: nab, ncd, n, i, m, m1, m2
double precision :: eab, ecd, e, c, s0, s1, s2, s3
double precision :: aea, aeb, aec, aed, ae, a2, acd, aab
aea = log(ea)
aeb = log(eb)
aec = log(ec)
aed = log(ed)
nab = na+nb
ncd = nc+nd
ecd = ec+ed
eab = ea+eb
e = ecd+eab
n = nab+ncd
ae = log(e)
a2 = log(two)
acd = log(ecd)
aab = log(eab)
c = exp(logfc(n)+na*aea+nb*aeb+nc*aec+nd*aed &
+half*(aea+aeb+aec+aed)+a2*(n+2) &
-half*(logfc(2*na+1)+logfc(2*nb+1) &
+logfc(2*nc+1)+logfc(2*nd+1))-ae*n)
c = c*au_to_ev
s0 = one/e
s1 = zero
s2 = zero
m = ncd-k
do i=1,m
s0 = s0*e/ecd
s1 = s1+s0*(binomialcoefficient(ncd-k,i)-binomialcoefficient(ncd+k+1,i))/binomialcoefficient(n,i)
enddo
m1 = m+1
m2 = ncd+k+1
do i=m1,m2
s0 = s0*e/ecd
s2 = s2+s0*binomialcoefficient(m2,i)/binomialcoefficient(n,i)
enddo
s3 = exp(ae*n-acd*m2-aab*(nab-k))/binomialcoefficient(n,m2)
slatercondon = c*(s1-s2+s3)
return
end function getslatercondonparameter
end module overlap_backend
|
Iβve been told that I have my motherβs eyes and my fatherβs smile. Sometimes the genetics we inherit reveal themselves in very obvious ways. And sometimes they donβt. Recently I wrote this post about DNA tests that can identify your skinβs inherent strengths and weaknesses, enabling you to pinpoint exactly what skincare products are best for you based on your unique genetic profile. This is a critical breakthrough because without this type of information, itβs impossible to know the specific needs of your skin. This is why we buy from the brands that we like (or that have a great sales pitch), get lucky with a few products and end up with a drawer full of skin care rejects that didnβt deliver as promised because they werenβt the right match for our skin. The beauty of these DNA tests is that they take out the guesswork, providing you with clear guidelines on how to shop for your skincare, supplements and professional skin treatments.
Of course I could hardly wait to take the test and reveal my skinβs genetic destiny, but I also truly wondered if the information would be valuable to me or not. As someone extremely well versed in skincare, I already knew how to cut through the category clutter and felt very confident in my skincare regimen.
Glycation Protection (Gene 3)β Quick skincare lesson: glycation occurs when excess bodily glucose (sugar) molecules link to the skinβs collagen and elastin fibers. Glycated fibers then become rigid and have reduced regenerative ability, leading to accelerated skin aging in the form of wrinkling and decreased elasticity. On a scale of 1-10, my skinβs ability to protect against glycation is about a 2.5. Major fail. So what do I do?
Well, this is where it gets interesting. New evidence in the study of epigenetics proves how the lifestyle choices we make can either speed up or slow down the aging process. This can take the form of deciding whether or not to wear sunscreen, or in my case, whether or not to lay off the sugar and carbs. So with this hard data in hand, I can either blame my inevitable premature aging on bad genes, or I can start eating a low sugar diet and basically eliminate the expression of this genetic deficiency. The test has given me the power to alter how my skin ages β whether I like what I need to do or not. Kind of mind blowing, right?
Now for some, this info wouldnβt be that enlightening. But it is for me β my husband is an owner in a gelato company and a partner in a bakery. I love sweets and eat more than I should, making this information highly valuable and certainly worth the $299 price of the test.
But enough about me. What do tests like this mean for the future of the skincare industry? Hereβs what I think. Right now, SkinDNA has the genetic data on over 40,000 people from a variety of ethnic backgrounds. They are adding to this at a rate of 15,000+ individuals a year and running all kinds of correlation studies. These studies generate statistics that have the ability to alter the way skincare is formulated and marketed. For example, they can identify genetic patterns among certain groups that can predict an increased likelihood of a genetic tendency. So I think itβs only a matter of time before this data is sold to a LβOreal or Estee Lauder who can use it to either create new brands or reposition existing ones using this hard data as a guide. Then for those like me who want an individualized DNA report, the door is opened for companies to create bespoke skincare including both topicals and injestibles. GENEU, who offers a test similar to what I took through SkinDNA, is currently offering a personalized anti-aging serum based on your DNA results. Product starts at Β£300 for a 4 week supply.
The really crazy thing is that DNA testing is just the tip of the iceberg when it comes to the future of customized skincare. New developments in biology will soon enable custom-made professional treatments, like using an individualβs own blood platelets to create protein-rich, collagen stimulating injectables. By using oneβs own skin tissue as the basis for a filler, it has the potential to last longer and be more effective. Then thereβs this: Biomedical Micro-engineering researchers at Heriot Watt University in Scotland, in collaboration with stem cell technology company Roslin Cellab, have created a breakthrough printing process that enables 3-D printing of embryonic cell cultures. These embryonic stem cells have an ability to replicate indefinitely and differentiate into almost any cell type in the human body (and I thought 3-D printed packaging was cool!). Since stem cells have the ability to regenerate damaged cells, this technology is expected to basically revolutionize the beauty industry and may truly become the future fountain of youth, all within the next two decades.
Of course Iβm all over this, so you can be sure that Iβll keep you posted as more and more research emerges. Itβs going to be a wild ride! |
Formal statement is: lemma bigomega_real_nat_transfer: "(f :: real \<Rightarrow> real) \<in> \<Omega>(g) \<Longrightarrow> (\<lambda>x::nat. f (real x)) \<in> \<Omega>(\<lambda>x. g (real x))" Informal statement is: If $f$ is big-Omega of $g$, then the function $x \mapsto f(x)$ is big-Omega of the function $x \mapsto g(x)$. |
lemma continuous_on_If: assumes closed: "closed s" "closed t" and cont: "continuous_on s f" "continuous_on t g" and P: "\<And>x. x \<in> s \<Longrightarrow> \<not> P x \<Longrightarrow> f x = g x" "\<And>x. x \<in> t \<Longrightarrow> P x \<Longrightarrow> f x = g x" shows "continuous_on (s \<union> t) (\<lambda>x. if P x then f x else g x)" (is "continuous_on _ ?h") |
f <- function () {
{;c0 = 1;}
}; g <- function () {
{c1 = 2}
}
|
theory Example_locale
imports Main
begin
(*locale: a functor - maps parameters and a specification \<longrightarrow> a list of declarations*)
(*parameter: le - a binary predicate with \<sqsubseteq>*)
locale partial_order =
fixes le :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infixl "\<sqsubseteq>" 50) (*declares a local parameter*)
assumes refl [intro, simp]: "x \<sqsubseteq> x" (* local premises*)
and anti_sym[intro]: "\<lbrakk> x \<sqsubseteq> y; y\<sqsubseteq> x \<rbrakk> \<Longrightarrow> x = y"
and trans[trans]: "\<lbrakk> x \<sqsubseteq> y; y\<sqsubseteq> z \<rbrakk> \<Longrightarrow> x \<sqsubseteq> z" (*\<And>x y z.\<lbrakk> x \<sqsubseteq> y; y\<sqsubseteq> z \<rbrakk> \<Longrightarrow> x \<sqsubseteq> z *)
begin
definition (in partial_order)
less :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infixl "\<sqsubset>" 50)
where "(x \<sqsubset> y) = (x \<sqsubseteq> y) \<and> (x \<noteq> y)"
end
print_locale! partial_order
thm partial_order_def
(*
definition (in partial_order)
less :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infixl "\<sqsubset>" 50)
where "(x \<sqsubset> y) = (x \<sqsubseteq> y) \<and> x \<noteq> y"
*)
locale total_order = partial_order +
assumes total: "x \<sqsubseteq> y \<or> y \<sqsubseteq> x"
lemma (in total_order) less_total: "x \<sqsubset> y \<or> x = y \<or> y \<sqsubset> x"
end |
```python
import numpy as np
import scipy.special as sci
import matplotlib.pyplot as plt
from scipy import stats # linregress
import pandas as pd
from IPython.display import Latex
```
## Lecture 10: Reactive Mass Transport
_(The contents presented in this section were re-developed principally by Dr. P. K. Yadav. The original contents are from Prof. Rudolf Liedl)_
---
The last lecture dealt with the conservative transport processes and quantified the mass flow and flux emanating from those processes. The effects of these processes were evaluated as an isolated processes and as joint transport process.
The last lecture dealt with the conservative transport processes and quantified the mass flow and flux emanating from those processes. The effects of these processes were evaluated as an isolated processes and as joint transport process.
```{admonition} Last lecture important conclusions
> $J_{adv}>J_{dis}>>J_{diff}$ is normal aquifers.
> $J_{diff}$ may only be useful as an individual processes in special aquifers, e.g., clayey aquifers.
> In general aquifers, hydrodynamic dispersion $J_{hyd} = J_{dis} + J_{diff}$ is used in the analysis of solute transport process.
```
Finally, the last chapter introduced _Concentration Profile_ $(C-t)$ and _Breakthrough Curve_ $(C-x)$ to visually evaluate solute transport in aquifers using _Concentration_ $(C)$, a process output, as a function of _time_ $(t)$ and _space_ $(x)$.
Finally, the last chapter introduced _Concentration Profile_ $(C-t)$ and _Breakthrough Curve_ $(C-x)$ to visually evaluate solute transport in aquifers using _Concentration_ $(C)$, a process output, as a function of _time_ $(t)$ and _space_ $(x)$.
This section focuses on the _reactive transport processes,_ which as already discussed involves the transport of solute with _reaction_ processes. This course being an introductory groundwater course, _sorption_ and _degradation_ are the only two reaction types introduced and combined with the conservative transport processes- _advection_ and _dispersion_. Eventully, the section evaluates the joint action of conservative transport and reactive processes limiting to 1-D scenario.
The section will, however, first deal with 3-D effects of dispersive process, which is more important to quantify the reactive processes.
## Dispersive Mass Flow in 3-D
In the last section we saw that concentration gradient $\frac{\Delta C}{\Delta L}$ drives dispersive and diffusive solute transport process.
However, in the natural aquifers $\frac{\Delta C}{\Delta L}$ is normally varying with space $(x,y,z)$ and time $(t)$. Therefore, a differential operator $\big(\frac{\mathrm{d}}{\mathrm{d} x}\big)$ is more suitable representation of gradient than the difference operator $\frac{\Delta C}{\Delta x}$. The differential operator also generalizes the gradient case.
Considering the differential operator, the diffusive mass flow and diffusive mass flux (= mass flow per unit area) in 1D is then expressed as:
$$
J_{diff} = - n_e \cdot A \cdot D_p \cdot \frac{\mathrm{d} C}{\mathrm{d}x}
$$
and
$$
j_{diff} = - n_e \cdot D_p \cdot \frac{\mathrm{d} C}{\mathrm{d}x}
$$
Likewise, the dispersive mass flow and dispersive mass flux (1-D) is:
$$
J_{disp, h} = - n_e \cdot A \cdot D_{disp} \cdot \frac{\mathrm{d} C}{\mathrm{d}x}
$$
$$
j_{disp, h} = - n_e \cdot D_{disp} \cdot \frac{\mathrm{d} C}{\mathrm{d}x}
$$
The examples of these relations are presented in last section (@Alex pls. link)
### 3-D concentration Gradient
The concentration gradient $\frac{\mathrm{d}C}{\mathrm{d}x}$ for 1-D solute transport problems is uni-directional, i.e, direction is fixed, and thus only the magnitude of the gradient is the important factor. However in higher dimensions, 2-D or 3-D, solute transport problems, the _direction_ of gradient along with it's _magnitude_ in that direction has to be specified. Thus, for higher dimension solute transport problems, the _concentration gradient_ becomes **concentration vector**, i.e., a quantity providing both magnitude and direction.
Thus, the representation of concentration gradient in Cartesian coordinate in 2-D and 3-D is:
$$
\mathrm{grad}C = \nabla C= \begin{pmatrix}
\frac{\partial C}{\partial x}\\
\frac{\partial C}{\partial y}
\end{pmatrix}
$$
and
$$
\mathrm{grad} C = \nabla C= \begin{pmatrix}
\frac{\partial C}{\partial x}\\
\frac{\partial C}{\partial y}\\
\frac{\partial C}{\partial z}
\end{pmatrix}
$$
The $\nabla$, the inverted Delta symbol, is called the **del** or **nabla** operator. The vector **grad$C$** in the above relations points in the direction of the _steepest increase_ of $C$. However, for the **Hydrogeologists**, the concentration gradients as well the grad$C$ points to the _steepest decrease_ of $C$.
**@Anne/Sophie - can we try to find a simple example finding grad$C$ in 2-D/3-D**
### Isotropic and Anisotropic Dispersion
Corresponding the expression for the concentration gradient at higher dimensions, the expression for mass flow and flux becomes:
$$
J_{disp,\, h} = \begin{pmatrix}
J_{disp,\, hx}\\
J_{disp,\, hy}\\
J_{disp,\, hz}
\end{pmatrix}
$$
and the 3-D mass flux is:
$$
j_{disp,\, h} = \begin{pmatrix}
j_{disp,\, hx}\\
j_{disp,\, hy}\\
j_{disp,\, hz}
\end{pmatrix}
$$
The subscript in ${{disp, h}}$ refers to _hydrodynamic dispersion_ which is sum of _mechanical dispersion_ and _diffusion_. Likewise, the subscript ${{disp,\, hx}}$, ${{disp,\, hy}}$ and ${{disp,\, hz}}$ refers to dispersion components along the Cartesian coordinates. The corresponding mass flow and mass flux in the higher dimension is then:
$$
J_{disp,\, h} = - n_e \cdot A \cdot D_{hyd} \cdot \text{grad}C
$$
and
### Isotropic and Anisotropic Dispersion
Corresponding the expression for the concentration gradient at higher dimensions, the expression for mass flow and flux becomes:
$$
J_{disp,\, h} = \begin{pmatrix}
J_{disp,\, hx}\\
J_{disp,\, hy}\\
J_{disp,\, hz}
\end{pmatrix}
$$
and the 3-D mass flux is:
$$
j_{disp,\, h} = \begin{pmatrix}
j_{disp,\, hx}\\
j_{disp,\, hy}\\
j_{disp,\, hz}
\end{pmatrix}
$$
The subscript in ${{disp,\, h}}$ refers to _hydrodynamic dispersion_ which is sum of _mechanical dispersion_ and _diffusion_. Likewise, the subscript ${{disp,\, hx}}$, ${{disp,\, hy}}$ and ${{disp,\, hz}}$ refers to dispersion components along the Cartesian coordinates. The corresponding mass flow and mass flux in the higher dimension is then:
$$
J_{disp,\, h} = - n_e \cdot A \cdot D_{hyd} \cdot \text{grad}C
$$
and
$$
j_{disp,\, h} = - n_e \cdot A \cdot D_{hyd} \cdot \text{grad}C
$$
The **isotropic dispersion**, rather an _exceptional,_ the $D_{hyd}$ in this case is:
$$
D_{hyd} = \alpha \cdot |v| + n_e \cdot D
$$
where, $D$ is direction independent dispersion coefficient and $\alpha$ $[L]$ is dispersivity, which in:
**heterogeneous aquifer**: $\alpha = \alpha(x,y,z)$ and in
**homogeneous aquifer**: $\alpha = \text{constant}$
For more practical cases and in normal aquifers, the 2-D and 3-D the dispersion for solute transport is _direction dependent,_ i.e. **anisotropic**. Hence the $D_{hyd}$ is not an scalar quantity but a _matrix (tensor),_ which relates the concentration gradient (vector) to the dispersive mass flow (vector). However, if the princopal axes of the dispersion tensor $D_{hyd}$ is made to coincide with the axes of a Cartesian coordinate system _and_ the groundwater flow is considered uniform along the $x-$axis, the dispersive mass flux can be obtained from
$$
\begin{pmatrix} J_x \\ j_y \\ j_z \end{pmatrix} =
\begin{pmatrix} \alpha_L \cdot v_x + n_e \cdot D & 0 & 0 \\
0 & \alpha_{Th} \cdot v_x + n_e \cdot D & 0\\
0 & 0 & \alpha_{Tv} \cdot v_x + n_e \cdot D
\end{pmatrix}
\cdot
\begin{pmatrix} \frac{\partial C}{\partial x} \\ \frac{\partial C}{\partial y} \\ \frac{\partial C}{\partial z} \end{pmatrix}
$$
with $\alpha_L$, $\alpha_{Th}$ and $\alpha_{Tv}$ are longitudinal dispersivity, horizontal transverse dispversity and vertical transverse dispersivity, respectively. The statistical analysis of dispersivity data shows that $\alpha_{L}>\alpha_{Th}>\alpha_{Tv}$ and the values differ by roughly an order of magnitude. This, however, is just a rule of thumb.
@Anne/@Sophie can you find a very simple numerical example for caculating dispersivity or something that explains the above relation.
```python
# Analytical solution from Bear (1976) - Line source, 1st-type input and infinte plane
# Input (values can be changed)
Co = 1 # mg/L, input concentration
Dx = 3 # m, Dispersion in x direction
Dy = Dx/10 # m
v = 0.05 # m/d
Q = 10 # m^3/d
## domain dimension and descritization (values can be changed)
xmin = -100; xmax= 101
ymin = 0.1; ymax = 11
[x, y] = np.meshgrid(np.linspace(xmin, xmax, 1000), np.linspace(ymin, ymax, 100)) # mesh
# Bear (1976) solution Implementation
#"k0: Modified Bessel function of second type and zero Order"
term1 = (Co*Q)/(2*np.pi* np.sqrt(Dx*Dy))
term2 = (x*v)/(2*Dx)
args = (v**2*x**2)/(4*Dx**2) + (v**2*y**2)/(4*Dx*Dy)
sol = term1*np.exp(term2)*sci.k0(args)
# plots
fig, ax = plt.subplots()
CS = ax.contour(x,y,sol, cmap='flag')
ax.clabel(CS, inline=1, fontsize= 10)
CB = fig.colorbar(CS, shrink=0.8, extend='both')
```
## Equilibrium Sorption ##
---
A reactive transport system can include a single reactive process, e.g., degradation, or combination of several multiple reactive processes, e.g. degradation and sorption. The inclusion of the reactive process(es) in the transport studies are site specific. The important to note is that an inclusion of a reactive process increases the complexity of transport problem.
In this course we limit ourselves with the following two types of reaction processes:
**1. Sorption**
**2. Degradation**
Acid-base reaction, precipitation-dissolution reaction, organic combustion etc. are among the reactions type that can be part of the reactive process individually or in any combination.
Also an important distinction is the rate or speed of the reaction. One distinguishes between time-dependent reaction (kinetics) or time-independent reactions (steady-state or equilibrium). Special reaction rates such as instantaneous reaction (extremely fast reaction) can also be part of the reaction process in the transport system.
### Sorption Basics
**Sorption** is a rather a general term used to indicate both **adsorption** and **absorption**. But in this course the _sorption_ refers to only _adsorption._
**Adsorption** can be more formally defined as the process of accumulation of dissolved chemicals on the surface of a solid, e.g., accumulation of a chemicals dissolved in groundwater on the surface of the aquifer material.
The figure below clarifies the _adsorption_ process.
<a href="fig5"></a>
In the figure _chemical in solution_ (the circular objects) more often called **solute** in the water is found to attach is the solid surface. The figure presents the following two important terms part of the adsorption process:
> **Adsorbent**: The solid onto which the chemicals are attached. More formally, _adsorbents_ provide adsorption sites for solutes.
> **Adsorbate**: These are solutes that are attached on the _adsorbent._
Based on the figure, _adsorption_ can be considered as a partition process that divides the chemical originally present in water between adsorbent and water.
Quite often adsorption is a reversible process, i.e., adsorbed chemicals can get back to water phase. This process is called **desorption**.
Speaking about _equilibrium,_ this is reached when
> _adsorption rate_ $\rightleftharpoons $ _desorption rate_
Adsorption in groundwater is often a rapid process. Although sorption kinetics can be important, the description in this introductory level course is limited to equilibrium sorption. Thus, we learn next to quantify equilibrium sorption.
### Adsorption Isotherms
The adsorption process that has reached equilibrium can be relatively easily quantified with the use of empirical models called **isotherms**. These models are often simple algebraic equation that relates solute concentrations partitioned between the adsorbate and adsorbent at constant temperature. More than 15 different _isotherm_ models can be found in the literature. However, in groundwater reactive transport studies the following three are the two most commonly used isotherms:
1. **Henry or Linear isotherm** <br>
2. **Freundlich isotherm**
For quantification, laboratory based experiments are performed using solids from subsurface and chemicals of interest. The laboratory observations are then graphically fitted with empirical isotherm models to quantify adsorption properties. Figure below shows isotherms that are particularly observed in groundwater transport studies. As can be observed in the figure sorption coefficient ($K$) is the common quantities obtained from isotherm models.
<a href="fig6"></a>
### Henry Isotherm
The **Henry isotherm** (Henry, 1803) is based on the idea of a _linear_ relationship between the solute concentration **$C$** and the _adsorbate:adsorbent_ mass ratio $C_a$. Henry isotherm is quite often also called _linear isotherm_ or the $K_d$ model. Mathematically, the Henry isotherm is:
$$
C_a = K_d \cdot C
$$
with
$C$ = solute concentration [ML$^{-3}$]<br>
$C_a$ = mass ratio adsorbate:adsorbent [M:M]<br>
$K_d$ = distribution or partitioning coefficient [L$^3$M$^{-1}$].
Often symbols $C_s$ or $s$ are used instead of $C_a$.
The Henry model has been most widely used in groundwater transport studies. This is largely because of the simplicity (see equation) of the model and it's applicability in representing adsorption process more generally observed in groundwater studies. $K_d$, the partitioning coefficient, is particularly used in groundwater transport studies. It is equal to the slope of the Henry isotherm.
```python
# Example of Henry isotherm (Source: Fetter et al. 2018)
# Following sorption data are available:
C = np.array([7, 15, 174, 249, 362]) # ug/L, Eq. concentration
Ca = np.array([2, 4, 33, 50, 70]) # ug/g, Eq. sorbed mass
# linear- fit y = m*x+c
slope, intercept, r_value, p_value, std_err = stats.linregress(C, Ca)
print("slope: %f intercept: %f R-squared: %f" % (slope, intercept, r_value**2))
fit_line = slope*C + intercept
#plot
plt.scatter(C, Ca, label= "Original data") # data plot
plt.plot(C, fit_line, color = "red", label = "fit-line")
plt.legend(); plt.xlabel(r"Equilibrium Aqueous Concentration, $C$ ($\mu$g/L) ")
plt.ylabel(r"Mass sorbed per unit absorbent weight, $C_a$ ($\mu$g/g) ");
plt.text(0, 50, '$C_a=%0.5s C + %0.5s$'%(slope, intercept), fontsize=10)
plt.text(0, 40, '$R^2=%0.5s $'%(r_value**2), fontsize=10)
# Output
Latex("The required partition coefficient = slope, $K_{d}$= %0.5s L/g " % slope)
```
### Freundlich Isotherm
**Freundlich isotherm** (Freundlich, 1907) is a more general isotherm. It is based on the idea of a power law, i.e., includes also the non-linear behaviour, relating the solute concentration $C$ to the adsorbate:adsorbent mass ration $C_a$. The isotherm is mathematically given as
$$
C_a = K_{Fr} \cdot C^N
$$
with
$C$ = solute concentration [ML$^{-3}$]<br>
$C_a$ = mass ratio adsorbate:adsorbent [M:M]<br>
$n$ = Freundlich exponent [-]<br>
$K_{Fr}$ = Freundlich partitioning coefficient [(M:M)/(M/L$^3)^n$].
The Freundlich isotherm equation can be easily linearized by applying logarithmic transformation of the equation, which gives
\begin{eqnarray}
\log C_a = \log K_{Fr} + n\cdot \log C
\end{eqnarray}
The above equation resembles the straight line equation $y = b + a \cdot x b$, in which $b\equiv \log K_{Fr}$ is the intercept and $a\equiv n$ the slope. Thus, from fitting the adsoprtion experimental results with the above equation, both $n$ and $K_{Fr}$ can be obtained.
```python
# Example of Freundlich isotherm
# Following sorption data are available:
Cf= np.array([23.6, 6.67, 3.26, 0.322, 0.169, 0.114]) # mg/L, Eq. concentration
Caf = np.array([737, 450, 318, 121, 85.2, 75.8]) # mg/g, Eq. sorbed mass
logCf = np.log10(Cf) # log10 transformation of data
logCaf = np.log10(Caf)
# fitting: y = mx +c
slope, intercept, r_value, p_value, std_err = stats.linregress(logCf, logCaf)
print("slope: %f intercept: %f R-squared: %f" % (slope, intercept, r_value**2))
fit_line = slope*logCf + intercept
# plots
plt.figure(figsize=(10,4))
plt.subplot(121)
plt.plot(Cf, Caf, "*--", label= "Original data")
plt.legend(); plt.xlabel(r"Eq. Aq. Conc., $C$ ($mg$g/L) ");
plt.ylabel(r"Mass sorbed/absorbent weight, $C_a$ ($mg$g/g) ");
plt.subplot(122)
plt.scatter(logCf, logCaf, label="Log transformed data")
plt.plot(logCf, fit_line, color="red", label= "linear fit line")
plt.legend(); plt.xlabel(r"Eq. Aq. Conc., $\log C$ ($mg$g/L) ");
plt.ylabel(r"Mass sorbed/absorbent weight, $\log C_a$ ($mg$/g) ");
plt.text(-1, 2.6, '$C_a=%0.5s C + %0.5s$'%(slope, intercept), fontsize=10)
plt.text(-1, 2.5, '$R^2=%0.5s $'%(r_value**2), fontsize=10)
plt.subplots_adjust(wspace=0.35)
Latex("$K_{Fr}$ = %0.5s (mg/g)$^{1/n}$(mg/L) and $n$ = %0.4s" % (10**intercept, slope))
```
### Retardation Factor (for Henry Isotherm)
The net effect of adsorption is the retarded movement of solute in comparison to the average flow of the groundwater. The term **Retardation Factor** $(R)$ is defined that quantifies the retarded movement of solute. The formulation of $R$ is based on the type of isotherm. For Henry isotherm $R$ can be straightforwardly calculated with the help of a mass budget.
For this purpose, an aquifer volume $V$ with the effective porosity $n_e$ is considered (see fig. below)
<a href="fig7"></a>
The steps involved are:
- Total volume: $V$
- Water volume: $n_e \cdot V$
- Mass of dissolved chemical: $n_e \cdot V \cdot C$
- Volume of solid: $(1-n_e)\cdot V$
- Density of solid material: $\rho$
- Mass of solid: $\rho \cdot(1-n_e)\cdot V$
- Mass of adsorbate: $\rho \cdot(1-n_e)\cdot V\cdot C_a$ = $(1-n_e)\cdot\rho \cdot V \cdot K_d \cdot C$
- Total mass: $n_e\cdot V \cdot C + (1-n_e)\cdot\rho \cdot V\cdot K_d \cdot C = n_e \cdot R \cdot V \cdot C$ <br>
with _Retardation factor_ $$R = 1 + \frac{1-n_e}{n_e}\cdot \rho \cdot K_d$$
The expression for $R$ can be further modified by using bulk density $\rho_b$ $= (1-n_e)\cdot \rho$ = mass of solid/total volume. This leads to
$$
R = 1+\frac{\rho_b}{n_e} \cdot K_d
$$
As can be observed from the equation, $R = 1$ when there is no adsorption, i.e., when $K_d= 0$.
@ Anne @ Sophie pls. provide a very short numerical example on R
## Degradation
**Degradation** leads to alteration or transformation of chemical structure of chemicals. This contrasts to adsorption in which chemical structure is not altered. In adsorption (or desorption) the original chemical is partitioned between the solid particles and water. It is _degradation_ that eventually lead to removal of the _original_ chemical from the groundwater. The transformation of original chemical, due to degradation, results to so-called _daughter products (metabolites)._ The new chemical(s) can make groundwater more suitable (decrease contamination) or further contaminate it.
In groundwater studies, degradation can appear as:
- **Radioactive decay**
- **Microbial degradation (bio-degradation)**
- **Chemical degradation**
There are several approaches to quantify degradation process.
A common aspect to most of them is the assumption of _time-dependency_ (or _Kinetics_ ).
### $n^{th}$ - Order Degradation Kinetics
The general equation for the degradation kinetics is:
$$
\frac{\text{d}C}{\text{d} t} = - \lambda \cdot C^n
$$
with $t$ = time [t] <br>
$C$ = solute concentration [ML$^{-3}$] <br>
$n$ = order of the degradation kinetics [ - ] ($n\geq 0)$ <br>
$\lambda$ = degradation rate constant [(ML$^{-3})^{(1-n)}$T$^{-1}$].
Considering the initial concentration (or input concentration) $C_0$, the solutions of the kinetics equation are:
$$
C(t) = C_0\cdot e^{-\lambda \cdot t} \: \: \: \text{if }\: n = 1
$$
and
$$
C(t) = [C_0^{1-n} - (1-n)\cdot \lambda t]^{\frac{1}{1-n}} \:\:\: \text{if }\: n\neq 1
$$
The **half life** $(T_{1/2})$, which is the time span elapsing until the initial concentration $C_0$ is reduced by half, is an important time-scale in the degradation analysis. $T_{1/2}$ is $C_0$ dependent in nearly all cases with an exception for 1$^\text{st}$- order degradation kinetics. 0$^{th}$-order and the 1$^\text{st}$- order degradation kinetics are most commonly observed in groundwater studies. The $(T_{1/2})$ of these orders are:
$$
T_{1/2} = \frac{C_0}{2\cdot \lambda} \:\:\: \text{for } \:0^{\text{th}}\text{-order}
$$
$$
T_{1/2} = \frac{\ln 2}{\lambda} \:\:\: \text{for } \:1^{\text{st}}\text{-order}
$$
As can be observed above $T_{1/2}$ is independent of concentration for the 1$^{\text{st}}$-order degradation kinetics.
Another important properties of the degradation kinetics is that for $n\geq 1$ the solute concentration _asymptotically_ approaches zero, whereas for $n<1$, the solute concentration actually reaches zero
```python
# behaviour of degradation kinetics
#input - you may change the values
Co = 1 # mg/L, initial concentration
la = 0.003 # unit is order dependent. For n=1, 1/t
# main equation
Z_order = lambda t: Co* np.exp(-la*t) # for n = 0
F_order = lambda t: Co-la*t # for n = 1
# simulation for t
t = np.linspace(1,1000, 1000) # 1000 time units
Z_results = Z_order(t)
F_results = F_order(t)
# plots
plt.figure(figsize=(10,4))
# n = 1
plt.subplot(121)
plt.plot(t, Z_results)
plt.ylim(0, Co); plt.xlim(0)
plt.text(400, Co*0.8, r"$C(t) = C_0 \cdot e^{-\lambda \cdot t} $", fontsize = 12)
plt.text (400, Co*0.9, r"1$^{st}$-order kinetics", color = "red", fontsize = 12)
plt.text(0, Co/2, r"$T_{1/2}= \frac{\ln 2}{\lambda}$", color= "red", fontsize=14)
plt.xlabel("Time, t (days)"); plt.ylabel(r"Concentration, $C(t)$ (mg/L)")
# n = 0
plt.subplot(122)
plt.plot(t, F_results)
plt.ylim(0, Co); plt.xlim(0)
plt.text(400, Co*0.8, r"$C(t) = C_0 \cdot-\lambda \cdot t} $", fontsize = 12)
plt.text (400, Co*0.9, r"0$^{th}$-order kinetics", color = "red", fontsize = 12)
plt.text(0, Co/2, r"$T_{1/2}= \frac{C_0}{2\cdot \lambda}$", color= "red", fontsize=14)
plt.xlabel("Time, t (days)"); plt.ylabel(r"Concentration, $C(t)$ (mg/L)")
plt.subplots_adjust(wspace=0.35)
```
### Radioactive decay
Radioactive decay is degradation of a chemical due to radiation. The radioactive decay is limited to radioactive chemicals such as Cobalt, Cesium, Iodine. This decay obeys the 1$^\text{st}$- order degradation kinetics and therefore the half-life is $T_{1/2} = \frac{\ln 2}{\lambda}$. $T_{1/2}$ is characteristic property of radioactive chemicals and it can be used to compute degradation rate ($\lambda$).
```python
# Example of Radioactive decaly
#experimental results
t = [0, 1, 2, 5, 10, 20, 28 ] # yr, time
Co_60 = [10, 8.76, 7.68, 5.17, 2.68, 0.72, 0.25] # mg/L, Cobalt 60 conc.
So_90 = [10, 9.76, 9.52, 8.84, 7.81, 6.10, 5] # mg/L, Strontium 90 Conc.
z_list = list(zip(t, Co_60, So_90))
Cols= ["time (a)", "Cobalt 60 (mg/L)", "Strontium 90 (mg/L)"]
df = pd.DataFrame(z_list, columns=Cols)
print(df)
# computing
TH_Co60 = 28 # yr, Half life of Cobalt 60
TH_St90 = 5.26 # yr, Half life of Strontium 90
la_Co60 = np.log(2)/TH_Co60 # 1/yr, degradation rate of Cobalt 60
la_St90 = np.log(2)/TH_St90 # 1/yr, degradation rate of Strontium 90
# visualize
plt.plot(t, Co_60, "o--", label = "Cobalt 60")
plt.plot(t, So_90, "v--", label= "Strontium 90")
plt.xlabel("Time (years)"); plt.ylabel("Concentration (mg/L)")
plt.legend();
Latex("The degradation rate ($\lambda$) for Cobalt 60 = %0.5s 1/y and for Strontium 90 = %0.5s 1/y" % (la_Co60, la_St90))
```
## Joint Action of Conservative and Reactive Transport (1D)
### Concentration Profile
Figure below presents the joint action of conservative transport with equilibrium sorption (linear isotherm) and degradation. The figure shows the solute concentration $C$ (in water) at the same time-levels for various combinations of acting processes.
<a href="fig8"></a>
The figure can be explained in the following way:
(A): The solute is initially present at constant concentration in a limited area.
(B): Solute spreads only due to advection. Due to absence of dispersion there is no (1D) spreading effect.
(C): Inclusion of dispersion process causes spread of concentration. As retardation is absence the front centreline remains unchanged
(D): The inclusion of retardation ($R$) with advection and dispersion leads to removal of chemicals from water and as well the retarded movement of the chemical front.
(E): The inclusion of retardation along with degradation and conservative transport process leads to high removal of chemical from water.
### Breakthrough Curve
Breakthrough curves provide a _time-dependent_ spread of chemicals in the groundwater. The inclusion of multiple processes are normally solved using numerical models. Analytical models are available for limited processes and simplified problems. A 1-D analytical solution by Kinzelbach (1987) provide a transient (time-dependent) solution of reactive transport problem with inclusion of equilibrium linear sorption represented by retardation $(R)$, first-order degradation rate $(\lambda)$ and the conservative transport quantities - dispersion $(D)$ and advection. The solution is given as:
$$
C(x,t) = C_0 \cdot \exp(-\lambda\cdot t)\bigg(1- \frac{1}{2}\text{erfc}\bigg(\frac{R\cdot x - v\cdot t}{2\cdot\sqrt{D\cdot R \cdot t}}\bigg) - \frac{1}{2}\exp\bigg(\frac{v\cdot x}{D}\bigg)\text{erfc}\bigg(\frac{R\cdot x + v\cdot t}{2\cdot\sqrt{D\cdot R \cdot t}}\bigg)
$$
with $C_0$ = input/source concentration [ML$^{-3}$] <br>
$t$ = time [T]<br>
$v$ = groundwater flow velocity [LT$^{-1}$]<br>
erfc() = represents the complementary error function [See here for details](https://en.wikipedia.org/wiki/Error_function). erfc() can be easily computed using Python Scipy special function library.
```python
# Breakthrough curve using Kinzelbach (1987) analytical solution Main function
# The main function - you may change the value of C_o, lam, R, Dx, v, x
# C_o = input concentration, mg/L
# lam = 0 # 1/d, degradation rate, 1/d
# R = retardation factor, ()
# Dx = dispersion coeff. along x, m^2/d
# v = groundwater velocity, m/d
# x = position where C is to be measured, m
def Cx(t, C_o= 1, lam = 0, R=1, Dx=1, v= 10, x = 20):
sterm = C_o*np.exp(-lam*t)
erf_ag1 = (R*x-v*t)/(2*np.sqrt(Dx*R*t))
erf_ag2 = (R*x+v*t)/(2*np.sqrt(Dx*R*t))
C = sterm*(1-(0.5*sci.erfc(erf_ag1)-0.5*np.exp((v*x)/Dx)*sci.erfc(erf_ag2)))
return C
```
```python
# Computing Case 1: Conservative process- R = 1, Lambda = 0
t1 = np.linspace(1e-5,50,1000) # times, d
C1 = Cx(t1, C_o= 1, lam = 0, R=1, Dx=1, v= 1, x = 20)
# Computing Case 2: Conservative system + Retardation - R = 2, Lambda = 0
t2 = np.linspace(1e-5,50,1000) # times, d
C2 = Cx(t2, C_o= 1, lam = 0, R=2, Dx=1, v= 1, x = 20)
# Computing Case 3: Conservative system + Retardation + degradation - R = 2, Lambda = 0.004
t3 = np.linspace(1e-5,50,1000) # times, d
C3 = Cx(t3, C_o= 1, lam = 0.004, R=2, Dx=1, v= 1, x = 20)
# plots - this should be adjusted as required
plt.figure(figsize=(9, 6))
plt.plot(t1, C1, label="Conservative transport")
plt.plot(t2, C2, label = "Reactive transport with sorption")
plt.plot(t3, C3, label = "Reactive transport with sorption and degradation rate")
plt.legend(loc= 3); plt.xlim(0), plt.ylim(0)
plt.xlabel("time (d)"); plt.ylabel(r"Concentration, $C$ (mg/L)")
plt.text(5, 0.2, r"$x= 20$ m")
```
### Mass (Re-)Distribution During Injection / Extraction
**Consider a scenario**:
Water is _injected_ into a certain portion of an aquifer with total volume $V$, bulk density $\rho_b$ and effective porosity $n_e$. Assume that the injected water contains a chemical of total mass $M$, which is adsorbed by the aquifer materials under equilibrium conditions according to Henry isotherm (quantified by $K_d$$).
Bases on the assumption of sorption equilibrium, the total mass $M$ of the chemical is instantaneously(!) split up into a dissolved and a sorbed part. In such case, the mass distribution can be computed as follows (with $R$ = retardation factor, $\rho_b$
= bulk density):
\begin{align}
M &= n_e \cdot V \cdot C + V\cdot\rho_b \cdot C_a \\
&= n_e \cdot V \cdot C + V \cdot \rho_b \cdot K_d \cdot C\\
&= n_e \cdot (1 + \rho_b \cdot K_d/n_e) \cdot V \cdot C\\
&= n_e \cdot R \cdot V \cdot C
\end{align}
In which,
$n_e \cdot V \cdot C$ = dissolved mass <br>
$V\cdot\rho_b \cdot C_a$ = mass of adsorbate
For the dissolved mass we thus have $n_e \cdot V \cdot C = M/R$ and consequently the mass of adsorbate is:<br>
$V\cdot\rho_b \cdot C_a = M- M/R = (1-1/R)\cdot M$
The same approach can be adopted for the **extraction** scenarios, i.e. equilibrium desorption.
|
[STATEMENT]
lemma (in monoid) Units_inv_closed [intro, simp]:
"x \<in> Units G ==> inv x \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<in> Units G \<Longrightarrow> inv x \<in> carrier G
[PROOF STEP]
apply (simp add: Units_def m_inv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<in> carrier G \<and> (\<exists>xa\<in>carrier G. xa \<otimes> x = \<one> \<and> x \<otimes> xa = \<one>) \<Longrightarrow> (THE y. y \<in> carrier G \<and> x \<otimes> y = \<one> \<and> y \<otimes> x = \<one>) \<in> carrier G
[PROOF STEP]
by (metis (mono_tags, lifting) inv_unique the_equality) |
module integrate_module
implicit none
private
public :: integral
contains
function integral(f, a, b, n) result (integral_result)
! Calculates a trapezoidal approximation to an area using n trapezoids
! The region is bounded by lines x=a, y=0, x=b, and the curve y=f(x)
interface
function f(x) result (f_result)
real, intent(in) :: x
real :: f_result
end function f
end interface
real, intent(in) :: a, b
integer, intent(in) :: n
real :: integral_result
real :: h, total
integer :: i
h = (b - a) / n
! Calculate the sum f(a)/2+f(a+h)+...+f(b-h)+f(b)/2
! Do the first and last terms first
total = 0.5 * (f(a) + f(b))
do i = 1, n - 1
total = total + f(a + i * h)
end do
integral_result = h * total
end function integral
end module integrate_module
module function_module
implicit none
private
public :: square
contains
function square(x) result (squared_x)
real, intent(in) :: x
real :: squared_x
squared_x = x ** 2
end function square
end module function_module
program integrate
use integrate_module
use function_module
implicit none
print *, integral(square, a=0.0, b=1.0, n=100)
end program integrate
|
The bodice of this design has a simple round neckline. The waistline sits at the natural waist level of the body and is highlighted with braid. Ties come from the side seam to fasten into a bow at the back. Mother of pearl button closure at the back.
The skirt is generously gathered and the length is to the knee.
Handmade and beautifully finished with a full lining of plain Liberty Lawn and french seams.
For special occasions - soft tulle netting can be added to the petticoat - giving just a little more fluffy volume and lightness to the skirt.
Please see tulle petticoat listing. |
From ch2o_compcert Require Export ch2o_lp64 countdown_ch2o.
From ch2o Require Import stringmap frontend_sound.
Local Open Scope string_scope.
Definition alloc_program_result: frontend_state K.
Proof.
set (a:=alloc_program (K:=K) decls β
).
assert (match a with inl _ => False | inr _ => True end). { exact I. }
destruct a. { elim H. }
destruct p.
exact f.
Defined.
Definition Ξ: env K := to_env alloc_program_result.
Definition Ξ΄: funenv K := to_funenv alloc_program_result.
Definition m0: mem K := to_mem alloc_program_result.
Definition S0 := initial_state m0 "main" [].
Goal env_t Ξ = β
.
Proof.
reflexivity.
Qed.
Goal stringmap_to_list (env_f Ξ) = [("main", ([], sintT%T))].
reflexivity.
Qed.
(*
Compute stringmap_to_list Ξ΄.
*)
Infix "<" := (EBinOp (CompOp LtOp))
(at level 70) : expr_scope.
Goal stringmap_to_list Ξ΄ = [
("main",
local{sintT} (
var 0 ::= cast{sintT%T} (# intV{sintT} 32767) ;;
catch (
loop (
if{# intV{sintT} 0 < load (var 0)} skip else throw 0 ;;
catch (
! (cast{voidT%T} (var 0 ::= load (var 0) - # intV{sintT} 1))
)
)
) ;;
ret (cast{sintT%T} (load (var 0)))
) : stmt K
)
].
Proof.
reflexivity.
Qed.
Lemma Ξ΄_main: Ξ΄ !! ("main": funname) = Some (
local{sintT} (
var 0 ::= cast{sintT%T} (# intV{sintT} 32767) ;;
catch (
loop (
if{# intV{sintT} 0 < load (var 0)} skip else throw 0 ;;
catch (
! (cast{voidT%T} (var 0 ::= load (var 0) - # intV{sintT} 1))
)
)
) ;;
ret (cast{sintT%T} (load (var 0)))
) : stmt K).
Proof.
reflexivity.
Qed.
Goal m0 = β
.
Proof.
reflexivity.
Qed.
Goal S0 = State [] (Call "main" []) m0.
Proof.
reflexivity.
Qed.
Lemma alloc_program_eq: alloc_program decls empty = mret () alloc_program_result.
Proof.
reflexivity.
Qed.
Lemma Ξ_valid: β Ξ.
Proof.
apply alloc_program_valid with (1:=alloc_program_eq).
Qed.
Lemma Ξ΄_valid: β{Ξ,'{m0}} Ξ΄.
Proof.
apply alloc_program_valid with (1:=alloc_program_eq).
Qed.
Lemma m0_valid: β{Ξ} m0.
apply alloc_program_valid with (1:=alloc_program_eq).
Qed.
|
\section{Literatura}
\begin{frame}{Literatura}
\begin{thebibliography}{9}
\setbeamertemplate{bibliography item}[online]
\bibitem{MRS}{
J.~Peterson
\newblock Finite Difference Methods for Boundary Value Problems
\newblock \url{http://people.sc.fsu.edu/~jpeterson/notes_fd.pdf}
}
\bibitem{RR}{
J.~Lambers
\newblock The Rayleigh-Ritz Method
\newblock \url{http://www.math.usm.edu/lambers/mat461/spr10/lecture27.pdf}
}
\end{thebibliography}
\end{frame}
|
\documentclass[11pt, a4paper, leqno]{article}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{float, afterpage, rotating, graphicx}
\usepackage{epstopdf}
\usepackage{longtable, booktabs, tabularx}
\usepackage{fancyvrb, moreverb, relsize}
\usepackage{eurosym, calc, chngcntr}
\usepackage{amsmath, amssymb, amsfonts, amsthm, bm}
\usepackage{caption}
\usepackage{mdwlist}
\usepackage{xfrac}
\usepackage{setspace}
\usepackage{xcolor}
% \usepackage{pdf14} % Enable for Manuscriptcentral -- can't handle pdf 1.5
% \usepackage{endfloat} % Enable to move tables / figures to the end. Useful for some submissions.
\usepackage[
natbib=true,
bibencoding=inputenc,
bibstyle=authoryear-ibid,
citestyle=authoryear-comp,
maxcitenames=3,
maxbibnames=10,
useprefix=false,
sortcites=true,
backend=biber
]{biblatex}
\AtBeginDocument{\toggletrue{blx@useprefix}}
\AtBeginBibliography{\togglefalse{blx@useprefix}}
\setlength{\bibitemsep}{1.5ex}
\addbibresource{refs.bib}
\usepackage[unicode=true]{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=black,
anchorcolor=black,
citecolor=black,
filecolor=black,
menucolor=black,
runcolor=black,
urlcolor=black
}
\widowpenalty=10000
\clubpenalty=10000
\setlength{\parskip}{1ex}
\setlength{\parindent}{0ex}
\setstretch{1.5}
\begin{document}
\title{TTT
\thanks{NNN: UUU, Address. \href{mailto:[email protected]} {\nolinkurl{x [at] y [dot] z}}, tel.~+00000.}
% subtitle:
% \\[1ex]
% \large Subtitle here
}
\author{NNN
% \\[1ex]
% Additional authors here
}
\date{
{\bf Preliminary -- please do not quote}
\\[1ex]
\today
}
\maketitle
\begin{abstract}
Some abstract here.
\end{abstract}
\clearpage
\section{Introduction} % (fold)
\label{sec:introduction}
If you are using this template, please cite this item from the references: \citet{GaudeckerEconProjectTemplates}
\citet{Schelling69} example in the code is taken from \citet{StachurskiSargent13}
The decision rule of an agent is the following:
\input{formulas/decision_rule}
\begin{figure}
\caption{Segregation by cycle in the baseline \citet{Schelling69} model as in the \citet{StachurskiSargent13} example}
\includegraphics[width=\textwidth]{../../out/figures/schelling_baseline}
\end{figure}
\begin{figure}
\caption{Segregation by cycle in the baseline \citet{Schelling69} model, limiting the number of potential moves per period to two}
\includegraphics[width=\textwidth]{../../out/figures/schelling_max_moves_2}
\end{figure}
% section introduction (end)
\setstretch{1}
\printbibliography
\setstretch{1.5}
%\appendix
%\counterwithin{table}{section}
%\counterwithin{figure}{section}
\end{document}
|
module Data.List.Properties.Extra {a}{A : Set a} where
open import Data.Nat
open import Data.Fin hiding (_<_)
open import Data.List
open import Data.Product hiding (map)
open import Data.Fin using (fromββ€; zero; suc)
open import Data.List.Relation.Unary.All hiding (map; lookup; _[_]β_)
open import Data.List.Relation.Unary.Any hiding (map; lookup)
open import Data.List.Membership.Propositional
open import Data.List.Relation.Binary.Pointwise hiding (refl; map)
open import Relation.Binary.PropositionalEquality
β-β·Κ³ : β (l : List A)(x : A) β x β (l β·Κ³ x)
β-β·Κ³ [] x = here refl
β-β·Κ³ (x β· l) y = there (β-β·Κ³ l y)
infixl 10 _[_]β_
_[_]β_ : (l : List A) β Fin (length l) β A β List A
[] [ () ]β x
(x β· xs) [ zero ]β x' = x' β· xs
(x β· xs) [ suc i ]β y = x β· xs [ i ]β y
infixl 10 _[_]β'_
_[_]β'_ : β {x} β (l : List A) β x β l β A β List A
[] [ () ]β' y
(x β· l) [ here px ]β' y = y β· l
(x β· l) [ there px ]β' y = x β· (l [ px ]β' y)
β'-[]= : β {x}{l : List A} (p : x β l) β β {y} β y β (l [ p ]β' y)
β'-[]= (here px) = here refl
β'-[]= (there p) = there (β'-[]= p)
drop-prefix : β (l m : List A) β drop (length l) (l ++ m) β‘ m
drop-prefix [] m = refl
drop-prefix (x β· l) m = drop-prefix l m
|
lemma affine_hull_convex_hull [simp]: "affine hull (convex hull S) = affine hull S" |
function p = mcmcProposalProbability2(pE, adjlist, pWhole, smap1, origseg, smap2, newseg, niter)
% compute probability of proposing newseg from smap1
% 1) Randomly select superpixel s1, then randomly selects different superpixel
% s2 within same segment (if one exists); remove s1,s2 from s
% 2) Then, for randomly ordered i:
% if si is adjacent to s1, assign si to s1 with probability pE(si, s1)
% if si is adjacent to s2, assign si to s2 with probability pE(si, s2)
% remove si from s
% 3) Repeat (2) until s is empty
nsp = numel(smap1);
ind1 = find(smap1==origseg);
ind2 = find(smap2==newseg);
n1 = numel(ind1);
n2 = numel(ind2);
if n1 == n2 % entire original segment selected
if n1==1
p = 1/nsp;
disp('one')
else
p = pWhole*n2/nsp;
disp('whole')
end
else % subset of segment selected
disp('subset')
p = (1-pWhole)*n2/nsp;
adjmat = zeros(n1, n1);
for k = 1:size(adjlist, 1)
if smap1(adjlist(k, 1))==origseg && smap1(adjlist(k, 2))==origseg
i1 = logical(ind1==adjlist(k, 1));
i2 = logical(ind1==adjlist(k, 2));
adjmat(i1, i2) = k;
adjmat(i2, i1) = k;
end
end
assntrue = 2*ones(n1, 1);
for k = 1:n1
if any(ind2==ind1(k))
assntrue(k) = 1;
end
adj{k} = find(adjmat(k, :));
adjlog{k} = logical(adjmat(k, :)>0);
end
notselectedind = find(assntrue==2);
p = p * (n1-n2) / (n1-1); % prob of selecting valid starting point for s2
cpos = 0;
cneg = 0;
assn = zeros(n1, 1);
for k = 1:niter
s1 = ind2(ceil(rand(1)*n2));
ts1 = find(ind1==s1);
ts2 = notselectedind(ceil(rand(1)*numel(notselectedind)));
if assntrue(ts2)~=2
cneg = cneg+1;
else
assn(:)=0;
assn(ts1)=1;
assn(ts2)=2;
rind = randperm(n1);
rind([ts1 ts2]) = [];
c = 0;
while ~isempty(rind)
for t = 1:numel(rind)
r = rind(t);
if ~assn(r)
assnr = assn(adjlog{r});
end
if ~assn(r) && sum(assnr)>0
assnr1 = logical(assnr==1);
assnr2 = logical(assnr==2);
isadj1 = any(assnr1);
isadj2 = any(assnr2);
if isadj1 && ~isadj2
adj1 = adj{r}(assnr1);
p = 1-prod(1-pE(adjmat(r, adj1)));
if rand(1) < p
assn(r) = 1;
end
elseif isadj2 && ~isadj1
adj2 = adj{r}(assnr2);
p = 1-prod(1-pE(adjmat(r, adj2)));
if rand(1) < p
assn(r) = 2;
end
else
adj1 = adj{r}(assnr1);
adj2 = adj{r}(assnr2);
p1 = 1-prod(1-pE(adjmat(r, adj1)));
p2 = 1-prod(1-pE(adjmat(r, adj2)));
p1 = p1 / (p1 + p2);
if rand(1) < p1
assn(r) = 1;
else
assn(r) = 2;
end
end
if (assn(r)==1 && assntrue(r)==2) || (assn(r)==2 && assntrue(r)==1)
assn(logical(assn==0)) = 3;
break;
end
end % end: if unassigned and has assigned adjacent sp
end % end: loop through randomly ordered indices
rind = rind(logical(assn(rind)==0));
end % end: loop until all assigned while any(~assn)
if any(assn~=assntrue)
cneg = cneg + 1;
else
cpos = cpos + 1;
end
end % end: if ts2 matches profile
end % end: loop over iterations
p = p * max(cpos/(cpos+cneg), 1/niter);
end % compute prob for subset
|
```
import numpy as np
import scipy as sp
import sympy
import matplotlib.pyplot as plt
import matplotlib as mpl
```
```
# activate pop up plots
#%matplotlib qt
# or change to inline plots
%matplotlib inline
```
```
# some sample data
x = np.arange(0,10,0.1)
```
```
page_width_cm = 13
dpi = 200
inch = 2.54 # inch in cm
# setting global plot configuration using the RC configuration style
plt.rc('font', family='serif')
plt.rc('xtick', labelsize=12) # tick labels
plt.rc('ytick', labelsize=20) # tick labels
plt.rc('axes', labelsize=20) # axes labels
# If you donβt need LaTeX, donβt use it. It is slower to plot, and text
# looks just fine without. If you need it, e.g. for symbols, then use it.
#plt.rc('text', usetex=True) #<- P-E: Doesn't work on my Mac
```
```
# create a figure instance, note that figure size is given in inches!
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(8,6))
# set the big title (note aligment relative to figure)
fig.suptitle("suptitle 16, figure alignment", fontsize=16)
# actual plotting
ax.plot(x, x**2, label="label 12")
# set axes title (note aligment relative to axes)
ax.set_title("title 14, axes alignment", fontsize=14)
# axes labels
ax.set_xlabel('xlabel 12')
ax.set_ylabel(r'$y_{\alpha}$ 12', fontsize=8)
# legend
ax.legend(fontsize=12, loc="best")
##############################################################
##Ploting Grid
plt.grid()
#Changing Legend
ax.legend(loc=4)
ax.plot(x, x**2,color="purple", lw=1, ls='-', marker='s',markevery=5, markersize=8,markerfacecolor="yellow", markeredgewidth=2, markeredgecolor="blue", label="label 12")
#Subplot
#SubPlot
fig, ax1 = plt.subplots(nrows=1, ncols=1, figsize=(8,6))
ax1.plot(x, x**3, label="label 12")
ax1.set_title("Sub-plotting", fontsize=14)
# saving the figure in different formats
fig.savefig('figure-%03i.png' % dpi, dpi=dpi)
fig.savefig('figure.svg')
fig.savefig('figure.eps')
```
```
### Countour Plotting
import math
from pylab import *
alpha = 0.7
phi_ext = 2 * math.pi * 0.5
def flux_qubit_potential(phi_m, phi_p):
return 2 + alpha - 2 * np.cos(phi_p)*np.cos(phi_m) - alpha * np.cos(phi_ext - 2*phi_p)
phi_m = np.linspace(0, 2*math.pi, 100)
phi_p = np.linspace(0, 2*math.pi, 100)
X,Y = np.meshgrid(phi_p, phi_m)
Z = flux_qubit_potential(X, Y).T
fig, ax = plt.subplots()
cnt = contour(Z, cmap=cm.RdBu, vmin=abs(Z).min(), vmax=abs(Z).max(), extent=[0, 1, 0, 1])
# Second Axis
ax2 = ax.twinx()
ax2.set_ylabel(r"Temperature ($^\circ$C)")
ax2.set_ylim(0, 35)
#Add Line
axvline(x=0.5, ymin=0, ymax=1)
axhline(y=25,xmin=0,xmax=1)
#autoformat dates for nice printing on the x-axis using fig.autofmt_xdate()
fig.autofmt_xdate(bottom=0.2, rotation=30, ha='right')
```
# Advanced exercises
We are going to play a bit with regression
-Create a vector x of equally spaced number between xβ[0,5Ο] of 1000 points (keyword: linspace)
-create a vector y, so that y=sin(x) with some random noise
-plot it
-Try to do a polynomial fit on y(x) using numpy.polyfit, with different polynomial degree
```
x= np.linspace(0, 5*math.pi, 1000)
Y= np.sin(x)
noise = np.random.normal(-0.1,0.1,1000)
y=Y+noise
fig, ax1 = plt.subplots(nrows=1, ncols=1, figsize=(8,6))
fig.suptitle("Sin + Noise", fontsize=16)
ax1.plot(x, y,color="black",lw=2, ls='*', marker='.', label="Sin(x) + Noise")
plt.plot(x,Y,color="red", linewidth=2.00,label="Sin(x)")
for i in [2,4,6,8,10]:
p = np.poly1d(np.polyfit(x,y,i))
plt.plot(x,p(x), linewidth=2.00,label="Fit order: "+str(i))
ax1.legend(fontsize=12, loc="best")
```
```
```
|
lemma cbox01_nonempty [simp]: "cbox 0 One \<noteq> {}" |
\section*{Introduction}
\input{content/abstract.tex}
Intuitively, it seems as if every natural science has \emph{laws of nature}:
A prominent example is Newton's \emph{law} of gravity in physics.
Aside from the fact that many powerful scientific concepts are called \enquote{laws},
many scientists also work under the assumption of laws, or
even actively try to discover new ones.
A logical-positivist might define a \emph{law of nature} in its simplest form as
a universal, necessary statement, which is not analytically true.
This definition\footnote{Many definitions are more elaborate,
I focused on the most essential parts.}
is widely agreed upon \cite[57]{philsciencebook}.
Laws of nature are required in \emph{covering law} (c.l.) models, like the
deductive-nomological (DN)
or the inductive-statistical (IS) model \cite[Ch. 3]{philsciencebook}.
This class of models requires a scientific explanation to
use at least one law of nature, which is relevant to (covers) the to-be-explained phenomenon.
Nancy Cartwright argues in her 1983 essay \enquote{The Truth Doesn't Explain Much}
that science does not use real laws of nature at all, rather that the explanation
is made using \emph{ceteris paribus generalizations} and thus
covering law models are false \cite{cartwright1980truth}.
\section*{Ceteris Paribus Generalizations}
According to Cartwright the common (and c.l.) view on scientific theories is, that they
express truths about nature and help us explain natural phenomena.
She argues this is false, since there are no covering laws
in most scientific explanations.
This means that they cannot account for most scientific explanations and thus
\enquote{covering-law models let in too little}\cite[2]{cartwright1980truth}.
But what do scientific theories use, if not laws of nature?
They use ceteris paribus (c.p.) generalizations:
statements which are applicable only under a specific set of conditions.
This makes them fail the condition of universality in the
definition of natural laws.
Cartwright believes there are no
exceptionless quantitative laws at all \cite[2]{cartwright1980truth}.
To understand this argument of Cartwright, let us look at an example
of atomic \enquote{laws}, take \enquote{Every atomic nucleus is positively charged.}.
It is not-analytic, necessary and general at first glance. But this is only true until we
learn of anti-matter, which has reversed charge, so atoms with negatively charged nuclei.
Hence, the actual law is \enquote{In matter, every atomic nucleus is positively charged}.
The addition of \enquote{In matter} is the ceteris paribus modifier, which makes the statement
true again, but it does not fulfill universality anymore.
Indeed, even the most successful physical theories,
have some sort of c.p. modifier, e.g.
\enquote{Under the condition that the gravity fields are not too strong,
Newton's laws hold true.}.
Today an even better theory emerged, Einstein's general relativity, which remains
the best theory of gravitation to date. But is this a natural law?
Physicists are very aware of its limitation,
and apply numerous c.p. modifiers to it, like \enquote{Except at the center of a black hole}
or \enquote{Except at quantum mechanical level}.
Indeed, no accepted physical theory today comes without c.p. modifiers.
\section*{Unknown Laws}
Is the statement about the positivity of an atom's nucleus a law,
if we don't yet know about the existence of antimatter?
A defender of c.l. models would argue, that even if what scientists believed to be a
natural law turns out wrong, there is some better, still unknown covering law, which is a true
natural law.
Cartwright objects this view, with two arguments \cite[5]{cartwright1980truth}.
Firstly, it is a possibility, that there are no laws.
This is not a necessity, but there seems to be no reason to discard this possibility.
Natural laws may not be needed after all.
Secondly, the promises of some still unknown law,
are no explanations,
but \enquote{they are at best assurances that explanations are to be had} \cite[5]{cartwright1980truth}.
If it comes in handy, we can choose to believe in (unknown) laws, Cartwright argues, but
we don't do that with any scientific reason.
We cannot test unknown laws and unknown laws can not explain anything.
\section*{Explanations}
But what if we are in a hypothetical scenario, where humankind has
found enough laws, so we can explain everything
\footnote{Physicists call this the \enquote{theory of everything}.}.
Is science over then?
No, it is still
\enquote{the job of science to tell us what kinds of explanations are admissible}\cite[7]{cartwright1980truth},
Cartwright argues.
Assume we observe an atom moving away from a positively charged electric source.
How does science explain this?
We have our c.p. law of \enquote{the nucleus of matter atoms is positively charged},
we know, that positive charges
repel each other, and that an atom has negatively charged electrons in its hull.
All these laws are either analytically or come with (numerous, implicit) c.p. modifiers.
The explanation is
\enquote{The atom moved away, because it was positively charged as a whole, since there
were more positive charges in the nucleus, than negative ones in the hull}.
Cartwright would argue this is the right explanation to give, even if we
can't be absolutely certain that it is right.
Science does not have to give perfect explanations, and can allow for some oversight
\cite[7,8]{cartwright1980truth}.
In fact, this explanation can be absolutely wrong: Maybe the atom is made of antimatter,
maybe it was not even the positively charged source, which made the atom move in the first place.
Even in the case, that this explanation is completely right, we never
used the more fundamental laws, which cover the phenomenon:
We did not employ the SchrΓΆdinger-Equation, nor Quantum-Field-Theory
and thus weaker c.p. generalizations are used in science to explain.
\section*{How Does Science Explain?}
I hold two objections with Cartwright's view on
the job of science.
While our explanation for why the atom moves might be
perfectly reasonable in everyday life, it is at best
a first hypothesis in a true scientific explanation
\footnote{Although I have chosen a different example than Cartwright herself,
this is also applicable to her dying camellias \cite[6]{cartwright1980truth}.}.
In reality, science doesn't just find a reasonable explanation and calls it a day,
a true scientific treatise explores (all) different
possible explanations to a phenomenon, and rules
out as many as possible, with repeated hypothesis-testing
and experimentation.
Secondly, while I admit that Cartwright gets rid of a lot of metaphysical implications
of natural laws, I do not think we need to go so far, as to get rid of them
completely. After all, scientists use them with great success.
A c.p. modifier does not make a law less general. In fact, I argue
it makes the law even more general. A natural law can include its own
limitations (c.p. modifiers): It is still applicable in general, it will
just tell you in some, or even most, of the cases that it is of no use.
Cartwright argues, that there is also the possibility that
no covering law might exist at all.
I disagree. Even in the case, that some things in the universe turn out to be
completely random, the law \enquote{Things happen with complete randomness.}
is a natural law.
I argue c.p. generalizations are natural laws, and they do explain a lot.
Science does not offer any absolute truths, but
in explaining (or describing) nature with c.p. laws at least
some truth can be found, with the restrictions the c.p. modifiers provide.
Take Newton's law of gravitation as a counterexample to Cartwright's argumentation:
After it was discovered, that Mercury did not follow Newton's laws, what did
science do?
Scientists predicted a new planet in the solar system, but
did they rest after giving this perfectly good explanation?
No, instead Einstein developed general relativity, which explained the same thing.
After the proposed planet was never seen, the new-planet-theory was discarded, and
we added a c.p. modifier to Newtonian gravity.
But Newtonian gravity still remains a useful, general law of nature to this day,
which in some cases tells you, to not use it.
There is still truth in Newtonian gravity.
This has no big metaphysical implications:
We do not need to believe that natural laws are true,
in the sense that they are always right and applicable.
In fact, science is about knowing the limitations of the
very laws it uses.
\section*{Conclusion}
Science uses \emph{ceteris paribus} laws.
Cartwright argues, that these are no laws of nature,
since they are not general with their c.p. modifiers.
While her argument elegantly gets rid of many
metaphysical implications, she removes more
than needed.
I argue, c.p. laws are still laws of nature, if we include the
c.p. modifiers, and with that they provide explanations.
These laws of nature provide some truth,
and are of central importance to scientific
explanation. |
(in-package :omega)
(th~deftheorem maxmal-implies-prime-ideal
(in abelian-ring)
(conclusion
(all-types aa bb
(forall (lam (M (o bb))
(forall (lam (P (o bb))
(forall (lam (R (o bb))
(implies (maximal-ideal M R)
(prime-ideal M R)))))))))))
|
[STATEMENT]
lemma isometry_bidual_embedding[simp]: \<open>isometry bidual_embedding\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. isometry bidual_embedding
[PROOF STEP]
by (simp add: norm_preserving_isometry) |
theory prop_58
imports Main
"$HIPSTER_HOME/IsaHipster"
begin
datatype 'a list = Nil2 | Cons2 "'a" "'a list"
datatype ('a, 'b) Pair2 = Pair "'a" "'b"
datatype Nat = Z | S "Nat"
fun zip2 :: "'a list => 'b list => (('a, 'b) Pair2) list" where
"zip2 (Nil2) y = Nil2"
| "zip2 (Cons2 z x2) (Nil2) = Nil2"
| "zip2 (Cons2 z x2) (Cons2 x3 x4) = Cons2 (Pair z x3) (zip2 x2 x4)"
fun drop :: "Nat => 'a list => 'a list" where
"drop (Z) y = y"
| "drop (S z) (Nil2) = Nil2"
| "drop (S z) (Cons2 x2 x3) = drop z x3"
(*hipster zip drop *)
lemma lemma_a [thy_expl]: "drop x3 Nil2 = Nil2"
by (hipster_induct_schemes drop.simps)
lemma lemma_aa [thy_expl]: "drop (S Z) (drop x3 y3) = drop (S x3) y3"
by (hipster_induct_schemes drop.simps)
(*hipster zip2*)
lemma lemma_ab [thy_expl]: "zip2 Nil2 x1 = zip2 x1 Nil2"
by (hipster_induct_schemes zip2.simps)
lemma lemma_ac [thy_expl]: "zip2 Nil2 x1 = zip2 y1 Nil2"
by (hipster_induct_schemes zip2.simps)
(*hipster zip2 drop*)
theorem x0 :
"(drop n (zip2 xs ys)) = (zip2 (drop n xs) (drop n ys))"
by (hipster_induct_schemes drop.simps zip2.simps Nat.exhaust)
(*
apply(induction xs ys arbitrary: n rule: zip2.induct)
apply(simp_all)
apply(metis drop.simps thy_expl zip2.simps)
apply(metis drop.simps thy_expl zip2.simps)
apply(metis drop.simps thy_expl zip2.simps Nat.exhaust)
by (tactic {* Subgoal.FOCUS_PARAMS (K (Tactic_Data.hard_tac @{context})) @{context} 1 *})*)
end
|
a <- as.hexmode(35)
b <- as.hexmode(42)
as.integer(a & b) # 34
as.integer(a | b) # 43
as.integer(xor(a, b)) # 9
|
Require Import GhostSimulations.
Require Import Raft.
Require Import UpdateLemmas.
Local Arguments update {_} {_} {_} _ _ _ _ : simpl never.
Require Import RaftRefinementInterface.
Require Import CommonTheorems.
Require Import SpecLemmas.
Require Import RefinementSpecLemmas.
Require Import LogsLeaderLogsInterface.
Require Import AppendEntriesRequestLeaderLogsInterface.
Require Import RefinedLogMatchingLemmasInterface.
Require Import AllEntriesLeaderLogsTermInterface.
Require Import LeaderLogsContiguousInterface.
Require Import OneLeaderLogPerTermInterface.
Require Import LeaderLogsSortedInterface.
Require Import TermSanityInterface.
Require Import AllEntriesTermSanityInterface.
Require Import AllEntriesLogInterface.
Section AllEntriesLog.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {llli : logs_leaderLogs_interface}.
Context {aerlli : append_entries_leaderLogs_interface}.
Context {rlmli : refined_log_matching_lemmas_interface}.
Context {aellti : allEntries_leaderLogs_term_interface}.
Context {llci : leaderLogs_contiguous_interface}.
Context {ollpti : one_leaderLog_per_term_interface}.
Context {llsi : leaderLogs_sorted_interface}.
Context {tsi : term_sanity_interface}.
Context {rri : raft_refinement_interface}.
Context {aetsi : allEntries_term_sanity_interface}.
(* strategy : prove allEntries_log as inductive invariant, then
prove allEntries_leaderLogs inductive from that *)
Ltac update_destruct :=
match goal with
| [ |- context [ update _ ?y _ ?x ] ] => destruct (name_eq_dec y x)
end.
Ltac update_destruct_hyp :=
match goal with
| [ _ : context [ update _ ?y _ ?x ] |- _ ] => destruct (name_eq_dec y x)
end.
Ltac destruct_update :=
repeat (first [update_destruct_hyp|update_destruct]; subst; rewrite_update).
Definition no_entries_past_current_term_host_lifted net :=
forall (h : name) e,
In e (log (snd (nwState net h))) ->
eTerm e <= currentTerm (snd (nwState net h)).
Lemma no_entries_past_current_term_host_lifted_invariant :
forall net,
refined_raft_intermediate_reachable net ->
no_entries_past_current_term_host_lifted net.
Proof using rri tsi.
unfold no_entries_past_current_term_host_lifted.
pose proof deghost_spec.
do 4 intro.
repeat find_reverse_higher_order_rewrite.
eapply lift_prop; eauto.
intros.
find_apply_lem_hyp no_entries_past_current_term_invariant; eauto.
Qed.
(** Succeed iff [x] is in the list [ls], represented with left-associated nested tuples. *)
Ltac inList x ls :=
match ls with
| x => idtac
| (_, x) => idtac
| (?LS, _) => inList x LS
end.
(** Try calling tactic function [f] on every element of tupled list [ls], keeping the first call not to fail. *)
Ltac app f ls :=
match ls with
| (?LS, ?X) => f X || app f LS || fail 1
| _ => f ls
end.
(** Run [f] on every element of [ls], not just the first that doesn't fail. *)
Ltac all f ls :=
match ls with
| (?LS, ?X) => f X; all f LS
| (_, _) => fail 1
| _ => f ls
end.
Lemma appendEntries_haveNewEntries_false :
forall net p t n pli plt es ci h e,
refined_raft_intermediate_reachable net ->
In p (nwPackets net) ->
pBody p = AppendEntries t n pli plt es ci ->
haveNewEntries (snd (nwState net h)) es = false ->
In e es ->
In e (log (snd (nwState net h))).
Proof using rlmli.
intros.
unfold haveNewEntries in *. do_bool. intuition;
[unfold not_empty in *; break_match; subst; simpl in *; intuition; congruence|].
break_match; try congruence.
do_bool. find_apply_lem_hyp findAtIndex_elim. intuition.
assert (es <> nil) by (destruct es; subst; simpl in *; intuition; congruence).
find_eapply_lem_hyp maxIndex_non_empty.
break_exists. intuition.
find_copy_eapply_lem_hyp entries_sorted_nw_invariant; eauto.
match goal with
| H : In e es |- _ => copy_eapply maxIndex_is_max H; eauto
end.
repeat find_rewrite.
find_eapply_lem_hyp entries_match_nw_host_invariant; eauto.
Qed.
Lemma maxIndex_le :
forall l1 l2,
sorted l1 ->
contiguous_range_exact_lo l1 0 ->
findAtIndex l1 (maxIndex l2) = None ->
l2 = nil
\/ (exists e, In e l2 /\ eIndex e = 0)
\/ maxIndex l1 <= maxIndex l2.
Proof using.
intros. destruct l2; intuition.
simpl in *. right.
destruct l1; intuition.
find_copy_eapply_lem_hyp findAtIndex_None; simpl in *; eauto.
unfold contiguous_range_exact_lo in *.
simpl in *. intuition.
destruct (lt_eq_lt_dec 0 (eIndex e)); intuition; eauto.
destruct (lt_eq_lt_dec (eIndex e0) (eIndex e)); intuition.
exfalso. repeat break_if; do_bool; intuition.
match goal with
| H : forall _, _ < _ <= _ -> _ |- _ =>
specialize (H (eIndex e))
end; conclude_using omega.
simpl in *. break_exists. intuition; subst; intuition.
eapply findAtIndex_None; eauto.
Qed.
Lemma maxIndex_le' :
forall l1 l2 i,
sorted l1 ->
contiguous_range_exact_lo l1 0 ->
l2 <> nil ->
contiguous_range_exact_lo l2 i ->
findAtIndex l1 (maxIndex l2) = None ->
maxIndex l1 <= maxIndex l2.
Proof using.
intros. find_eapply_lem_hyp maxIndex_le; intuition; eauto.
break_exists. intuition.
unfold contiguous_range_exact_lo in *.
intuition.
find_insterU. conclude_using eauto. omega.
Qed.
Lemma sorted_app_in_in :
forall l1 l2 e e',
sorted (l1 ++ l2) ->
In e l1 ->
In e' l2 ->
eIndex e' < eIndex e.
Proof using.
induction l1; intros; simpl in *; intuition; eauto.
subst. find_insterU. conclude_using ltac:(apply in_app_iff; intuition eauto).
intuition.
Qed.
Lemma sorted_app_sorted_app_in1_in2 :
forall l1 l2 l3 e e',
sorted (l1 ++ l3) ->
sorted (l2 ++ l3) ->
In e l1 ->
In e' (l2 ++ l3) ->
eIndex e' = eIndex e ->
In e' l2.
Proof using.
intros. do_in_app. intuition.
match goal with
| H : sorted (?l ++ ?l'), _ : In _ ?l, _ : In _ ?l' |- _ =>
eapply sorted_app_in_in in H
end; eauto. omega.
Qed.
Lemma sorted_app_sorted_app_in1_in2_prefix :
forall l1 l2 l3 l4 e e',
sorted (l1 ++ l3) ->
sorted (l2 ++ l4) ->
Prefix l4 l3 ->
In e l1 ->
In e' (l2 ++ l4) ->
eIndex e' = eIndex e ->
In e' l2.
Proof using.
intros. do_in_app. intuition.
find_eapply_lem_hyp Prefix_In; [|eauto].
match goal with
| H : sorted (?l ++ ?l'), _ : In _ ?l, _ : In _ ?l' |- _ =>
eapply sorted_app_in_in in H
end; eauto. omega.
Qed.
Lemma sorted_app_in2_in2 :
forall l1 l2 e e',
sorted (l1 ++ l2) ->
In e' (l1 ++ l2) ->
In e l2 ->
eIndex e' = eIndex e ->
In e' l2.
Proof using.
intros. do_in_app. intuition.
match goal with
| H : sorted (?l ++ ?l'), _ : In _ ?l, _ : In _ ?l' |- _ =>
eapply sorted_app_in_in in H
end; eauto. omega.
Qed.
(* Lemma sorted_app_in3_in4_prefix :
forall l1 l2 l3 l4 e e',
sorted (l1 ++ l3) ->
sorted (l2 ++ l4) ->
Prefix l4 l3 ->
In e l3 ->
In e' (l2 ++ l4) ->
eIndex e' = eIndex e ->
In e' l4.
Proof.
intros. do_in_app. intuition.
match goal with
| H : sorted (?l ++ ?l'), _ : In _ ?l, _ : In _ ?l' |- _ =>
eapply sorted_app_in_in in H
end; eauto. omega.
Qed.
*)
Lemma sorted_term_index_le :
forall l e e',
sorted l ->
In e l ->
In e' l ->
eTerm e' < eTerm e ->
eIndex e' <= eIndex e.
Proof using.
induction l; intros; simpl in *; intuition; subst_max; intuition.
- find_apply_hyp_hyp. intuition.
- find_apply_hyp_hyp. intuition.
Qed.
Lemma term_ne_in_l2 :
forall l e e' l1 l2,
sorted l ->
In e l ->
(forall e', In e' l -> eTerm e' <= eTerm e) ->
removeAfterIndex l (eIndex e) = l1 ++ l2 ->
(forall e', In e' l1 -> eTerm e' = eTerm e) ->
In e' l ->
eTerm e' <> eTerm e ->
In e' l2.
Proof using.
intros.
assert (eIndex e' <= eIndex e) by
(eapply sorted_term_index_le; eauto;
find_apply_hyp_hyp;
destruct (lt_eq_lt_dec (eTerm e') (eTerm e)); intuition).
find_eapply_lem_hyp removeAfterIndex_le_In; eauto.
repeat find_rewrite.
do_in_app. intuition.
find_apply_hyp_hyp. intuition.
Qed.
Lemma Prefix_maxIndex_eq :
forall l l',
Prefix l l' ->
l <> nil ->
maxIndex l = maxIndex l'.
Proof using.
intros.
induction l; simpl in *; intuition.
break_match; intuition. subst. simpl. auto.
Qed.
Lemma sorted_gt_maxIndex :
forall e l1 l2,
sorted (e :: l1 ++ l2) ->
l2 <> nil ->
maxIndex l2 < eIndex e.
Proof using.
intros; induction l1; simpl in *; intuition.
- destruct l2; simpl in *; intuition.
match goal with
| H : forall _, ?e = _ \/ _ -> _ |- _ =>
specialize (H e)
end; intuition.
Qed.
Lemma allEntries_log_append_entries :
refined_raft_net_invariant_append_entries allEntries_log.
Proof using aetsi rri tsi llsi ollpti llci aellti rlmli aerlli llli.
red. unfold allEntries_log in *. simpl in *. intros.
repeat find_higher_order_rewrite.
destruct_update; simpl in *;
[|find_apply_hyp_hyp; intuition;
right; break_exists_exists; intuition;
repeat find_higher_order_rewrite;
destruct_update; simpl in *;
eauto; rewrite update_elections_data_appendEntries_leaderLogs; eauto].
find_eapply_lem_hyp update_elections_data_appendEntries_allEntries_detailed; eauto.
intuition;
[|repeat find_rewrite;
find_eapply_lem_hyp appendEntries_haveNewEntries_false; eauto].
find_copy_apply_hyp_hyp. intuition;
[|right; break_exists_exists; intuition;
repeat find_higher_order_rewrite; destruct_update; simpl in *; eauto;
try rewrite update_elections_data_appendEntries_leaderLogs; eauto; subst;
find_apply_lem_hyp handleAppendEntries_currentTerm_leaderId; intuition;
repeat find_rewrite; auto].
destruct (in_dec entry_eq_dec e (log d)); intuition.
right.
find_copy_apply_lem_hyp handleAppendEntries_log_detailed.
intuition; repeat find_rewrite; intuition.
- subst.
find_copy_eapply_lem_hyp allEntries_term_sanity_invariant; eauto.
destruct (lt_eq_lt_dec t0 (currentTerm d)); intuition; unfold ghost_data in *; simpl in *; try omega.
+ find_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists. break_and.
match goal with
| H : In (?t, ?ll) (leaderLogs (fst (nwState _ ?leader))) |- _ =>
(exists t, leader, ll)
end.
split;
[repeat find_higher_order_rewrite;
destruct_update; simpl in *;
eauto; rewrite update_elections_data_appendEntries_leaderLogs; eauto|];
split; auto; intuition;
[break_exists; intuition;
find_eapply_lem_hyp leaderLogs_contiguous_invariant; eauto; omega|].
subst. repeat find_rewrite. intuition.
+ subst.
find_eapply_lem_hyp allEntries_leaderLogs_term_invariant; eauto. intuition.
* subst. exfalso.
find_copy_eapply_lem_hyp logs_leaderLogs_invariant; eauto.
find_copy_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists; intuition;
[break_exists; intuition;
find_eapply_lem_hyp leaderLogs_contiguous_invariant; eauto; omega|].
subst. clean.
repeat find_rewrite.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
match goal with
| H : In _ _ -> False |- _ =>
apply H
end.
find_copy_eapply_lem_hyp entries_sorted_invariant; eauto.
unfold entries_sorted in *.
repeat find_rewrite.
match goal with
| _ : removeAfterIndex ?l (eIndex ?e) = _ |- _ =>
assert (In e (removeAfterIndex l (eIndex e))) by
(eapply removeAfterIndex_le_In; eauto)
end.
repeat find_rewrite.
do_in_app; intuition.
assert (exists e', eIndex e' = eIndex e /\ In e' (x1 ++ x4)) by
(eapply entries_contiguous_nw_invariant; eauto;
intuition; [eapply entries_contiguous_invariant; eauto|];
eapply le_trans; [eapply maxIndex_is_max; eauto|];
eapply maxIndex_le'; eauto;
[eapply entries_contiguous_invariant; eauto|
eapply entries_contiguous_nw_invariant; eauto]).
break_exists. intuition.
find_copy_eapply_lem_hyp sorted_app_sorted_app_in1_in2. Focus 5. eauto. Focus 4. eauto.
all:(try solve [eapply entries_sorted_nw_invariant; eauto]).
all:(try solve [repeat find_reverse_rewrite; eauto using removeAfterIndex_sorted]).
find_apply_hyp_hyp.
find_eapply_lem_hyp entries_match_nw_host_invariant; eauto; repeat conclude_using eauto.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
eapply uniqueIndices_elim_eq in H
end; eauto using sorted_uniqueIndices.
subst. auto.
* exfalso.
find_copy_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists; intuition;
[break_exists; intuition;
find_eapply_lem_hyp leaderLogs_contiguous_invariant; eauto; omega|].
subst. clean.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
match goal with
| H : In _ _ -> False |- _ =>
apply H
end.
repeat find_rewrite. apply in_app_iff; intuition.
- subst.
find_copy_eapply_lem_hyp allEntries_term_sanity_invariant; eauto.
destruct (lt_eq_lt_dec t0 (currentTerm d)); intuition; unfold ghost_data in *; simpl in *; try omega.
+ find_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists. break_and.
match goal with
| H : In (?t, ?ll) (leaderLogs (fst (nwState _ ?leader))) |- _ =>
(exists t, leader, ll)
end. find_higher_order_rewrite.
split;
[subst; find_higher_order_rewrite;
destruct_update; simpl in *;
eauto; rewrite update_elections_data_appendEntries_leaderLogs; eauto|];
split; auto.
intuition;
[break_exists; intuition;
find_eapply_lem_hyp leaderLogs_contiguous_invariant; eauto; omega|].
subst. repeat find_rewrite. intuition.
+ subst.
find_eapply_lem_hyp allEntries_leaderLogs_term_invariant; eauto. intuition.
* { subst. exfalso.
find_copy_eapply_lem_hyp logs_leaderLogs_invariant; eauto.
find_copy_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists; intuition;
[break_exists; intuition;
find_eapply_lem_hyp leaderLogs_contiguous_invariant; eauto; omega|].
subst. clean.
repeat find_rewrite.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
match goal with
| H : In _ _ -> False |- _ =>
apply H
end.
find_copy_eapply_lem_hyp entries_sorted_invariant; eauto.
unfold entries_sorted in *.
repeat find_rewrite.
match goal with
| _ : removeAfterIndex ?l (eIndex ?e) = _ |- _ =>
assert (In e (removeAfterIndex l (eIndex e))) by
(eapply removeAfterIndex_le_In; eauto)
end.
repeat find_rewrite.
do_in_app; intuition.
find_apply_lem_hyp findAtIndex_elim. intuition.
find_copy_apply_lem_hyp maxIndex_non_empty.
break_exists.
intuition.
match goal with
| _ : In ?e' (log _), _ : maxIndex ?l = eIndex ?e' |- _ =>
destruct (le_lt_dec (eIndex e) (maxIndex l))
end.
- assert (exists e', eIndex e' = eIndex e /\ In e' (x1 ++ x4)) by
(eapply entries_contiguous_nw_invariant; eauto; intuition;
eapply entries_gt_0_invariant; eauto).
break_exists. intuition.
find_copy_eapply_lem_hyp sorted_app_sorted_app_in1_in2. Focus 5. eauto. Focus 4. eauto.
all:(try solve [eapply entries_sorted_nw_invariant; eauto]).
all:(try solve [repeat find_reverse_rewrite; eauto using removeAfterIndex_sorted]).
find_apply_hyp_hyp.
find_eapply_lem_hyp entries_match_nw_host_invariant; eauto; repeat conclude_using eauto.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
eapply uniqueIndices_elim_eq in H
end; eauto using sorted_uniqueIndices.
subst. auto.
- exfalso.
repeat find_rewrite.
match goal with
| _ : eIndex ?e' = eIndex ?x,
_ : eIndex ?x < ?i,
_ : context [removeAfterIndex ?l ?i] |- _ =>
assert (In e' (removeAfterIndex l i)) by
(eapply removeAfterIndex_le_In; auto; omega)
end.
repeat find_rewrite.
do_in_app. intuition.
+ find_copy_eapply_lem_hyp sorted_app_sorted_app_in1_in2. Focus 4. eauto.
all:eauto.
all:(try solve [eapply entries_sorted_nw_invariant; eauto]).
all:(try solve [repeat find_reverse_rewrite; eauto using removeAfterIndex_sorted]).
repeat find_apply_hyp_hyp. repeat find_rewrite. intuition.
+ find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
find_copy_eapply_lem_hyp sorted_app_in2_in2. Focus 3. eauto.
all:eauto.
all:(try solve [eapply entries_sorted_nw_invariant; eauto]).
match goal with
| H : eIndex ?e1 = eIndex ?e2, _ : In ?e1 ?ll, _ : In ?e2 ?ll |- _ =>
eapply uniqueIndices_elim_eq with (xs0 := ll) in H
end; eauto using sorted_uniqueIndices.
subst. intuition.
}
* exfalso.
find_copy_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists; intuition;
[break_exists; intuition;
find_eapply_lem_hyp leaderLogs_contiguous_invariant; eauto; omega|].
subst. clean.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
match goal with
| H : In _ _ -> False |- _ =>
apply H
end.
repeat find_rewrite. apply in_app_iff; intuition.
- find_copy_eapply_lem_hyp allEntries_term_sanity_invariant; eauto.
destruct (lt_eq_lt_dec t0 t); intuition; unfold ghost_data in *; simpl in *; try omega.
+ match goal with
| H : context [pBody] |- _ =>
copy_eapply append_entries_leaderLogs_invariant H
end; eauto.
break_exists. break_and. subst.
match goal with
| H : In (?t, ?ll) (leaderLogs (fst (nwState _ ?leader))) |- _ =>
(exists t, leader, ll)
end.
split;
[find_higher_order_rewrite;
destruct_update; simpl in *;
eauto; rewrite update_elections_data_appendEntries_leaderLogs; eauto|];
split; auto. intuition; subst.
* find_false.
apply in_app_iff. right. eapply removeAfterIndex_le_In; eauto.
find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
eapply le_trans; [eapply maxIndex_is_max; eauto|]. omega.
* {
break_exists. intuition. unfold Prefix_sane in *. intuition.
- destruct (le_lt_dec (eIndex e) (eIndex x3)).
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. right. apply removeAfterIndex_le_In; auto.
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. left.
apply in_app_iff. right.
find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
eapply prefix_contiguous; eauto.
find_copy_eapply_lem_hyp entries_sorted_nw_invariant; eauto.
eapply contiguous_app; eauto.
eapply entries_contiguous_nw_invariant; eauto.
- find_false.
repeat find_rewrite.
apply in_app_iff. right.
find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
apply removeAfterIndex_le_In; auto.
eapply maxIndex_is_max; eauto.
}
* find_false. intuition.
+ subst.
find_eapply_lem_hyp allEntries_leaderLogs_term_invariant; eauto. intuition.
* { subst. exfalso.
find_copy_eapply_lem_hyp logs_leaderLogs_invariant; eauto.
find_copy_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists. break_and.
repeat find_rewrite.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto.
conclude_using eauto. subst. intuition.
- repeat find_rewrite.
destruct (le_lt_dec (eIndex e) (eIndex x6)).
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. right. apply removeAfterIndex_le_In; auto.
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. left.
find_copy_eapply_lem_hyp entries_sorted_invariant.
find_eapply_lem_hyp maxIndex_le'; eauto;
[|eapply entries_contiguous_invariant; eauto|eapply entries_contiguous_nw_invariant; eauto].
find_copy_eapply_lem_hyp entries_contiguous_nw_invariant; eauto.
unfold contiguous_range_exact_lo in *.
break_and.
find_copy_eapply_lem_hyp entries_sorted_invariant.
match goal with
| H : forall _, _ < _ <= _ -> _ |- _ =>
specialize (H (eIndex e));
conclude_using ltac:(intuition; eapply le_trans; [eapply maxIndex_is_max; eauto|]; eauto)
end.
break_exists. break_and.
match goal with
| H : eIndex ?x = eIndex e |- _ =>
copy_eapply entries_match_nw_host_invariant H
end; eauto.
find_copy_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
conclude_using
ltac:(match goal with
| H : _ |- _ => apply H
end; do_in_app; intuition;
match goal with
| H : In ?x _ |- In ?x _ =>
copy_eapply Prefix_maxIndex H
end; [|idtac|eauto]; eauto; omega).
conclude_using eauto. conclude_using auto.
match goal with
| H : _ = _ |- _ =>
eapply uniqueIndices_elim_eq in H
end; eauto; eauto using sorted_uniqueIndices.
subst. auto.
- break_exists. break_and.
destruct (le_lt_dec (eIndex e) (eIndex x6)).
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. right. apply removeAfterIndex_le_In; auto.
+ match goal with
| _ : removeAfterIndex _ (eIndex ?e) = ?l |- _ =>
assert (In e l) by (repeat find_reverse_rewrite;
eapply removeAfterIndex_le_In; auto)
end.
find_copy_eapply_lem_hyp entries_sorted_invariant.
assert (exists e', eIndex e' = eIndex e /\ In e' (x1 ++ x2)) by
(eapply entries_contiguous_nw_invariant; eauto;
intuition;
eapply le_trans; [eapply maxIndex_is_max; eauto|];
eapply maxIndex_le'; eauto;
[eapply entries_contiguous_invariant; eauto|
eapply entries_contiguous_nw_invariant; eauto]).
do_in_app. intuition.
* break_exists. break_and.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
copy_eapply sorted_app_sorted_app_in1_in2_prefix H
end; eauto.
all:try solve [repeat find_reverse_rewrite; eauto using removeAfterIndex_sorted].
all:try solve [eapply entries_sorted_nw_invariant; eauto].
find_apply_hyp_hyp.
match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. left.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
copy_eapply entries_match_nw_host_invariant H
end; eauto. concludes. repeat conclude_using eauto.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
copy_eapply uniqueIndices_elim_eq H
end; eauto using sorted_uniqueIndices. subst. auto.
* find_copy_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
unfold Prefix_sane in *.
intuition; [|find_eapply_lem_hyp maxIndex_is_max; eauto; omega].
find_eapply_lem_hyp prefix_contiguous. Focus 2. eauto.
all:eauto.
all:try solve [eapply contiguous_app; [|eapply entries_contiguous_nw_invariant; eauto];
eapply entries_sorted_nw_invariant; eauto].
match goal with
| H : In e _ -> False |- _ => apply H
end. intuition.
- subst.
destruct (le_lt_dec (eIndex e) (eIndex x6)).
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. right. apply removeAfterIndex_le_In; auto.
+ match goal with
| _ : removeAfterIndex _ (eIndex ?e) = ?l |- _ =>
assert (In e l) by (repeat find_reverse_rewrite;
eapply removeAfterIndex_le_In; auto)
end.
find_copy_eapply_lem_hyp entries_sorted_invariant.
assert (exists e', eIndex e' = eIndex e /\ In e' (x1 ++ x4)) by
(eapply entries_contiguous_nw_invariant; eauto;
intuition;
eapply le_trans; [eapply maxIndex_is_max; eauto|];
eapply maxIndex_le'; eauto;
[eapply entries_contiguous_invariant; eauto|
eapply entries_contiguous_nw_invariant; eauto]).
do_in_app. intuition.
* break_exists. break_and.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
copy_eapply sorted_app_sorted_app_in1_in2 H
end; eauto.
all:try solve [repeat find_reverse_rewrite; eauto using removeAfterIndex_sorted].
all:try solve [eapply entries_sorted_nw_invariant; eauto].
find_apply_hyp_hyp.
match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. left.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
copy_eapply entries_match_nw_host_invariant H
end; eauto. concludes. repeat conclude_using eauto.
match goal with
| H : eIndex _ = eIndex _ |- _ =>
copy_eapply uniqueIndices_elim_eq H
end; eauto using sorted_uniqueIndices. subst. auto.
* match goal with
| H : In e _ -> False |- _ => apply H
end. intuition.
}
* { exfalso.
find_copy_apply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists; intuition.
copy_eapply_prop_hyp append_entries_leaderLogs pBody; eauto.
break_exists; break_and.
subst.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
match goal with
| H : In _ _ -> False |- _ =>
apply H
end.
find_copy_apply_lem_hyp leaderLogs_sorted_invariant; auto.
find_copy_apply_lem_hyp maxIndex_is_max; auto.
destruct (le_lt_dec (eIndex e) (eIndex x1));
[apply in_app_iff; right; eapply removeAfterIndex_le_In; eauto|].
repeat find_rewrite. apply in_app_iff; intuition.
- omega.
- break_exists; break_and.
unfold Prefix_sane in *. break_or_hyp; try omega.
left; apply in_app_iff; right.
eapply prefix_contiguous; eauto.
eapply contiguous_app; [|eapply entries_contiguous_nw_invariant; eauto];
eapply entries_sorted_nw_invariant; eauto.
- subst. intuition.
}
- find_copy_eapply_lem_hyp allEntries_term_sanity_invariant; eauto.
destruct (lt_eq_lt_dec t0 t); intuition; unfold ghost_data in *; simpl in *; try omega.
+ match goal with
| H : context [pBody] |- _ =>
copy_eapply append_entries_leaderLogs_invariant H
end; eauto.
break_exists. break_and. subst.
match goal with
| H : In (?t, ?ll) (leaderLogs (fst (nwState _ ?leader))) |- _ =>
(exists t, leader, ll)
end.
split;
[find_higher_order_rewrite;
destruct_update; simpl in *;
eauto; rewrite update_elections_data_appendEntries_leaderLogs; eauto|];
split; auto. intuition; subst.
* find_false.
apply in_app_iff. right. eapply removeAfterIndex_le_In; eauto.
find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
eapply le_trans; [eapply maxIndex_is_max; eauto|]. omega.
* {
break_exists. intuition. unfold Prefix_sane in *. intuition.
- destruct (le_lt_dec (eIndex e) (eIndex x4)).
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. right. apply removeAfterIndex_le_In; auto.
+ match goal with
| H : In e _ -> False |- _ => apply H
end.
apply in_app_iff. left.
apply in_app_iff. right.
find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
eapply prefix_contiguous; eauto.
find_copy_eapply_lem_hyp entries_sorted_nw_invariant; eauto.
eapply contiguous_app; eauto.
eapply entries_contiguous_nw_invariant; eauto.
- find_false.
repeat find_rewrite.
apply in_app_iff. right.
find_eapply_lem_hyp leaderLogs_sorted_invariant; eauto.
apply removeAfterIndex_le_In; auto.
eapply maxIndex_is_max; eauto.
}
* find_false. intuition.
+ subst.
find_eapply_lem_hyp allEntries_leaderLogs_term_invariant; eauto. intuition.
* { subst. exfalso.
find_copy_eapply_lem_hyp logs_leaderLogs_invariant; eauto.
find_copy_eapply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists. break_and.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto.
repeat find_rewrite.
conclude_using eauto. subst.
find_eapply_lem_hyp le_antisym; eauto.
destruct x1.
- simpl in *. destruct x2; simpl in *; auto.
break_match; auto.
match goal with
| H : _ \/ (exists _, _) \/ _ |- _ =>
clear H
end.
break_and. subst.
cut (e1 = x6); intros; subst; auto.
find_apply_lem_hyp findAtIndex_elim.
break_and.
find_copy_apply_lem_hyp entries_sorted_invariant.
eapply uniqueIndices_elim_eq; eauto using sorted_uniqueIndices.
eapply removeAfterIndex_in with (i := (eIndex e)).
unfold raft_data, ghost_data in *; simpl in *.
unfold raft_data, ghost_data in *; simpl in *.
repeat find_rewrite. intuition.
- simpl in *.
match goal with
| H : forall _, ?e = _ \/ _ -> _ |- _ =>
specialize (H e)
end. conclude_using auto.
repeat find_rewrite.
find_apply_lem_hyp findAtIndex_elim. break_and.
find_eapply_lem_hyp term_ne_in_l2. Focus 7. eauto. all:eauto.
all:try solve [eapply entries_sorted_invariant; eauto].
all:try solve [intros; find_eapply_lem_hyp no_entries_past_current_term_host_lifted_invariant; unfold ghost_data, raft_data in *; simpl in *;
unfold ghost_data, raft_data in *; simpl in *;
repeat find_rewrite; eauto].
assert (eIndex e0 <= maxIndex x4) by
(repeat find_rewrite;
eapply maxIndex_is_max; eauto;
eapply leaderLogs_sorted_invariant; eauto).
assert (eIndex x7 < eIndex e0) by
(eapply entries_contiguous_nw_invariant; eauto; intuition).
intuition.
+ break_exists. break_and.
unfold Prefix_sane in *. intuition.
find_copy_eapply_lem_hyp Prefix_maxIndex_eq; eauto.
find_eapply_lem_hyp entries_sorted_nw_invariant; eauto.
find_eapply_lem_hyp sorted_gt_maxIndex; eauto; omega.
+ subst.
find_eapply_lem_hyp entries_sorted_nw_invariant; eauto.
find_eapply_lem_hyp sorted_gt_maxIndex; eauto; try omega.
destruct x4; simpl in *; congruence.
}
* { exfalso.
find_copy_apply_lem_hyp append_entries_leaderLogs_invariant; eauto.
break_exists; intuition. subst.
copy_eapply_prop_hyp append_entries_leaderLogs pBody; eauto.
break_exists; break_and.
subst.
find_eapply_lem_hyp one_leaderLog_per_term_log_invariant; eauto;
conclude_using eauto. subst.
match goal with
| H : In _ _ -> False |- _ =>
apply H
end.
find_copy_apply_lem_hyp leaderLogs_sorted_invariant; auto.
find_copy_apply_lem_hyp maxIndex_is_max; auto.
destruct (le_lt_dec (eIndex e) (eIndex x2));
[apply in_app_iff; right; eapply removeAfterIndex_le_In; eauto|].
repeat find_rewrite. apply in_app_iff; intuition.
- omega.
- break_exists; break_and.
unfold Prefix_sane in *. break_or_hyp; try omega.
left; apply in_app_iff; right.
eapply prefix_contiguous; eauto.
eapply contiguous_app; [|eapply entries_contiguous_nw_invariant; eauto];
eapply entries_sorted_nw_invariant; eauto.
- subst. intuition.
}
Qed.
Lemma handleAppendEntriesReply_currentTerm_leaderId :
forall h st h' t es res st' m,
handleAppendEntriesReply h st h' t es res = (st', m) ->
currentTerm st < currentTerm st' \/
(currentTerm st = currentTerm st' /\ leaderId st' = leaderId st).
Proof using.
intros. unfold handleAppendEntriesReply, advanceCurrentTerm in *.
repeat (break_match; try find_inversion; simpl in *; auto).
Qed.
Lemma allEntries_log_append_entries_reply :
refined_raft_net_invariant_append_entries_reply allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp handleAppendEntriesReply_log.
find_apply_lem_hyp handleAppendEntriesReply_currentTerm_leaderId.
destruct_update; simpl in *; eauto; find_apply_hyp_hyp; repeat find_rewrite; intuition;
right; break_exists_exists; repeat find_rewrite; intuition;
find_higher_order_rewrite;
destruct_update; simpl in *; auto.
Qed.
Lemma update_elections_data_requestVote_leaderLogs :
forall h h' t lli llt st,
leaderLogs (update_elections_data_requestVote h h' t h' lli llt st) =
leaderLogs (fst st).
Proof using.
unfold update_elections_data_requestVote.
intros.
repeat break_match; auto.
Qed.
Lemma update_elections_data_requestVoteReply_leaderLogs :
forall h h' t st t' ll' r,
In (t', ll') (leaderLogs (fst st)) ->
In (t', ll') (leaderLogs (update_elections_data_requestVoteReply h h' t r st)).
Proof using.
unfold update_elections_data_requestVoteReply.
intros.
repeat break_match; auto.
simpl in *. intuition.
Qed.
Lemma allEntries_log_request_vote :
refined_raft_net_invariant_request_vote allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp handleRequestVote_log.
find_apply_lem_hyp handleRequestVote_currentTerm_leaderId.
destruct_update; simpl in *; eauto;
try find_rewrite_lem update_elections_data_requestVote_allEntries;
find_apply_hyp_hyp; repeat find_rewrite; intuition;
right; break_exists_exists; intuition; repeat find_higher_order_rewrite;
destruct_update; simpl in *; auto;
rewrite update_elections_data_requestVote_leaderLogs; auto.
Qed.
Lemma handleRequestVoteReply_log' :
forall h st h' t r,
log (handleRequestVoteReply h st h' t r) = log st.
Proof using.
eauto using handleRequestVoteReply_log.
Qed.
Lemma allEntries_log_request_vote_reply :
refined_raft_net_invariant_request_vote_reply allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
find_copy_apply_lem_hyp handleRequestVoteReply_currentTerm_leaderId.
repeat find_higher_order_rewrite.
destruct_update; simpl in *; eauto;
try rewrite handleRequestVoteReply_log';
try find_rewrite_lem update_elections_data_requestVoteReply_allEntries;
find_apply_hyp_hyp; repeat find_rewrite; intuition;
right; break_exists_exists; repeat find_rewrite; intuition;
find_higher_order_rewrite;
destruct_update; simpl in *; auto;
apply update_elections_data_requestVoteReply_leaderLogs; auto.
Qed.
Lemma update_elections_data_client_request_allEntries' :
forall h st client id c out st' ms t e,
handleClientRequest h (snd st) client id c = (out, st', ms) ->
In (t, e) (allEntries (update_elections_data_client_request h st client id c)) ->
In (t, e) (allEntries (fst st)) \/
In e (log st').
Proof using.
intros.
unfold update_elections_data_client_request in *.
repeat break_match; repeat find_inversion; auto.
simpl in *. intuition.
find_inversion. repeat find_rewrite. intuition.
Qed.
Lemma handleClientRequest_currentTerm_leaderId :
forall h st client id c out st' ms,
handleClientRequest h st client id c = (out, st', ms) ->
currentTerm st' = currentTerm st /\
leaderId st' = leaderId st.
Proof using.
intros. unfold handleClientRequest in *.
subst.
break_match; try find_inversion; simpl in *; auto.
Qed.
Lemma allEntries_log_client_request :
refined_raft_net_invariant_client_request allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
repeat find_higher_order_rewrite.
destruct_update; simpl in *;
try (find_eapply_lem_hyp update_elections_data_client_request_allEntries'; eauto; [idtac]);
intuition;
find_copy_apply_lem_hyp handleClientRequest_log;
find_apply_lem_hyp handleClientRequest_currentTerm_leaderId;
intuition;
try break_exists; intuition; repeat find_rewrite; intuition; simpl in *;
find_apply_hyp_hyp; intuition; repeat right;
break_exists_exists; intuition;
repeat find_higher_order_rewrite;
destruct_update; simpl in *; auto;
rewrite update_elections_data_client_request_leaderLogs; auto.
Qed.
Lemma handleTimeout_currentTerm_leaderId :
forall h st out st' ms,
handleTimeout h st = (out, st', ms) ->
currentTerm st < currentTerm st' \/
currentTerm st' = currentTerm st /\ leaderId st' = leaderId st.
Proof using.
intros. unfold handleTimeout, tryToBecomeLeader in *.
subst.
break_match; try find_inversion; simpl in *; auto.
Qed.
Lemma allEntries_log_timeout :
refined_raft_net_invariant_timeout allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
repeat find_higher_order_rewrite.
destruct_update; simpl in *;
try find_rewrite_lem update_elections_data_timeout_allEntries;
find_copy_apply_lem_hyp handleTimeout_log_same;
find_apply_lem_hyp handleTimeout_currentTerm_leaderId;
repeat find_rewrite;
find_apply_hyp_hyp; intuition;
right; break_exists_exists; intuition;
repeat find_higher_order_rewrite;
destruct_update; simpl in *; auto;
rewrite update_elections_data_timeout_leaderLogs; auto.
Qed.
Lemma doLeader_currentTerm_leaderId :
forall st h out st' m,
doLeader st h = (out, st', m) ->
currentTerm st' = currentTerm st /\
leaderId st' = leaderId st.
Proof using.
intros. unfold doLeader, advanceCommitIndex in *.
repeat break_match; find_inversion; simpl in *; auto.
Qed.
Lemma allEntries_log_do_leader :
refined_raft_net_invariant_do_leader allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
match goal with
| H : nwState ?net ?h = (?gd, ?d) |- _ =>
replace gd with (fst (nwState net h)) in * by (rewrite H; reflexivity);
replace d with (snd (nwState net h)) in * by (rewrite H; reflexivity);
clear H
end.
repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp doLeader_log.
find_apply_lem_hyp doLeader_currentTerm_leaderId.
destruct_update; simpl in *; eauto; find_apply_hyp_hyp; repeat find_rewrite; intuition;
right; break_exists_exists; intuition; find_higher_order_rewrite;
destruct_update; simpl in *; auto.
Qed.
Lemma doGenericServer_currentTerm_leaderId :
forall st h out st' m,
doGenericServer h st = (out, st', m) ->
currentTerm st' = currentTerm st /\
leaderId st' = leaderId st.
Proof using.
intros. unfold doGenericServer in *.
repeat break_match; find_inversion;
use_applyEntries_spec; subst; simpl in *;
auto.
Qed.
Lemma allEntries_log_do_generic_server :
refined_raft_net_invariant_do_generic_server allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
match goal with
| H : nwState ?net ?h = (?gd, ?d) |- _ =>
replace gd with (fst (nwState net h)) in * by (rewrite H; reflexivity);
replace d with (snd (nwState net h)) in * by (rewrite H; reflexivity);
clear H
end.
repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp doGenericServer_log.
find_apply_lem_hyp doGenericServer_currentTerm_leaderId.
destruct_update; simpl in *; eauto; find_apply_hyp_hyp; repeat find_rewrite; intuition;
right; break_exists_exists; intuition; find_higher_order_rewrite;
destruct_update; simpl in *; auto.
Qed.
Lemma allEntries_log_init :
refined_raft_net_invariant_init allEntries_log.
Proof using.
red. unfold allEntries_log. intros. simpl in *. intuition.
Qed.
Lemma allEntries_log_state_same_packet_subset :
refined_raft_net_invariant_state_same_packet_subset allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros.
repeat find_reverse_higher_order_rewrite.
find_apply_hyp_hyp. intuition. right.
break_exists_exists. repeat find_higher_order_rewrite. auto.
Qed.
Lemma allEntries_log_reboot :
refined_raft_net_invariant_reboot allEntries_log.
Proof using.
red. unfold allEntries_log in *. intros. simpl in *.
match goal with
| H : nwState ?net ?h = (?gd, ?d) |- _ =>
replace gd with (fst (nwState net h)) in * by (rewrite H; reflexivity);
replace d with (snd (nwState net h)) in * by (rewrite H; reflexivity);
clear H
end.
repeat find_higher_order_rewrite.
subst. unfold reboot in *.
destruct_update; simpl in *; eauto; find_apply_hyp_hyp; repeat find_rewrite; intuition;
right; break_exists_exists; intuition; find_higher_order_rewrite;
destruct_update; simpl in *; auto.
Qed.
Lemma allEntries_log_invariant :
forall net,
refined_raft_intermediate_reachable net ->
allEntries_log net.
Proof using aetsi rri tsi llsi ollpti llci aellti rlmli aerlli llli.
intros. apply refined_raft_net_invariant; auto.
- exact allEntries_log_init.
- exact allEntries_log_client_request.
- exact allEntries_log_timeout.
- exact allEntries_log_append_entries.
- exact allEntries_log_append_entries_reply.
- exact allEntries_log_request_vote.
- exact allEntries_log_request_vote_reply.
- exact allEntries_log_do_leader.
- exact allEntries_log_do_generic_server.
- exact allEntries_log_state_same_packet_subset.
- exact allEntries_log_reboot.
Qed.
Instance aeli : allEntries_log_interface.
split. eauto using allEntries_log_invariant.
Defined.
End AllEntriesLog. |
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.ZCohomology.Properties where
{-
This module contains:
1. direct proofs of connectedness of Kn and Ξ©Kn
2. Induction principles for cohomology groups of pointed types
3. Equivalence between cohomology of A and reduced cohomology of (A + 1)
4. Equivalence between cohomology and reduced cohomology for dimension β₯ 1
5. Encode-decode proof of Kβ β Ξ©Kβββ and proofs that this equivalence
and its inverse are morphisms
6. A proof of coHomGr β
coHomGrΞ©
7. A locked (non-reducing) version of Kβ β Ξ©Kβββ
-}
open import Cubical.ZCohomology.Base
open import Cubical.ZCohomology.GroupStructure
open import Cubical.HITs.S1 hiding (encode ; decode)
open import Cubical.HITs.Sn
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Transport
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Pointed
open import Cubical.Foundations.Pointed.Homogeneous
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.GroupoidLaws renaming (assoc to assocβ)
open import Cubical.Foundations.Univalence
open import Cubical.HITs.Susp
open import Cubical.HITs.SetTruncation renaming (rec to sRec ; rec2 to sRec2 ; elim to sElim ; elim2 to sElim2 ; setTruncIsSet to Β§)
open import Cubical.Data.Int renaming (_+_ to _β€+_) hiding (-_)
open import Cubical.Data.Nat
open import Cubical.HITs.Truncation renaming (elim to trElim ; map to trMap ; map2 to trMap2; rec to trRec ; elim3 to trElim3)
open import Cubical.Homotopy.Loopspace
open import Cubical.Homotopy.Connected
open import Cubical.Algebra.Group hiding (Unit ; Int)
open import Cubical.Algebra.AbGroup
open import Cubical.Algebra.Semigroup
open import Cubical.Algebra.Monoid
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Data.Sum.Base hiding (map)
open import Cubical.Functions.Morphism
open import Cubical.Data.Sigma
open Iso renaming (inv to inv')
private
variable
β β' : Level
------------------- Connectedness ---------------------
is2ConnectedKn : (n : β) β isConnected 2 (coHomK (suc n))
is2ConnectedKn zero = β£ β£ base β£ β£
, trElim (Ξ» _ β isOfHLevelPath 2 (isOfHLevelTrunc 2) _ _)
(trElim (Ξ» _ β isOfHLevelPath 3 (isOfHLevelSuc 2 (isOfHLevelTrunc 2)) _ _)
(toPropElim (Ξ» _ β isOfHLevelTrunc 2 _ _) refl))
is2ConnectedKn (suc n) = β£ β£ north β£ β£
, trElim (Ξ» _ β isOfHLevelPath 2 (isOfHLevelTrunc 2) _ _)
(trElim (Ξ» _ β isPropβisOfHLevelSuc (3 + n) (isOfHLevelTrunc 2 _ _))
(suspToPropElim (ptSn (suc n)) (Ξ» _ β isOfHLevelTrunc 2 _ _) refl))
isConnectedKn : (n : β) β isConnected (2 + n) (coHomK (suc n))
isConnectedKn n = isOfHLevelRetractFromIso 0 (invIso (truncOfTruncIso (2 + n) 1)) (sphereConnected (suc n))
-- direct proof of connectedness of Ξ©Kβββ not relying on the equivalence β₯ a β‘ b β₯β β (β£ a β£βββ β‘ β£ b β£βββ)
isConnectedPathKn : (n : β) (x y : (coHomK (suc n))) β isConnected (suc n) (x β‘ y)
isConnectedPathKn n =
trElim (Ξ» _ β isPropβisOfHLevelSuc (2 + n) (isPropΞ Ξ» _ β isPropIsContr))
(sphereElim _ (Ξ» _ β isPropβisOfHLevelSuc n (isPropΞ Ξ» _ β isPropIsContr))
Ξ» y β isContrRetractOfConstFun
{B = (hLevelTrunc (suc n) (ptSn (suc n) β‘ ptSn (suc n)))} β£ refl β£
(funβ» n y
, trElim (Ξ» _ β isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _)
(J (Ξ» y p β funβ» n y _ β‘ _) (funExtβ» (funβ»Id n) β£ refl β£))))
where
funβ» : (n : β) β (y : coHomK (suc n)) β
hLevelTrunc (suc n) (ptSn (suc n) β‘ ptSn (suc n))
β hLevelTrunc (suc n) (β£ ptSn (suc n) β£ β‘ y)
funβ» n =
trElim (Ξ» _ β isOfHLevelΞ (3 + n) Ξ» _ β isOfHLevelSuc (2 + n) (isOfHLevelSuc (suc n) (isOfHLevelTrunc (suc n))))
(sphereElim n (Ξ» _ β isOfHLevelΞ (suc n) Ξ» _ β isOfHLevelTrunc (suc n)) Ξ» _ β β£ refl β£)
funβ»Id : (n : β) β funβ» n β£ ptSn (suc n) β£ β‘ Ξ» _ β β£ refl β£
funβ»Id zero = refl
funβ»Id (suc n) = refl
-------------------
-- Induction principles for cohomology groups (n β₯ 1)
-- If we want to show a proposition about some x : HβΏ(A), it suffices to show it under the
-- assumption that x = β£ f β£β for some f : A β Kβ and that f is pointed
coHomPointedElim : {A : Type β} (n : β) (a : A) {B : coHom (suc n) A β Type β'}
β ((x : coHom (suc n) A) β isProp (B x))
β ((f : A β coHomK (suc n)) β f a β‘ coHom-pt (suc n) β B β£ f β£β)
β (x : coHom (suc n) A) β B x
coHomPointedElim {β' = β'} {A = A} n a isprop indp =
sElim (Ξ» _ β isOfHLevelSuc 1 (isprop _))
Ξ» f β helper n isprop indp f (f a) refl
where
helper : (n : β) {B : coHom (suc n) A β Type β'}
β ((x : coHom (suc n) A) β isProp (B x))
β ((f : A β coHomK (suc n)) β f a β‘ coHom-pt (suc n) β B β£ f β£β)
β (f : A β coHomK (suc n))
β (x : coHomK (suc n))
β f a β‘ x β B β£ f β£β
-- pattern matching a bit extra to avoid isOfHLevelPlus'
helper zero isprop ind f =
trElim (Ξ» _ β isOfHLevelPlus {n = 1} 2 (isPropΞ Ξ» _ β isprop _))
(toPropElim (Ξ» _ β isPropΞ Ξ» _ β isprop _) (ind f))
helper (suc zero) isprop ind f =
trElim (Ξ» _ β isOfHLevelPlus {n = 1} 3 (isPropΞ Ξ» _ β isprop _))
(suspToPropElim base (Ξ» _ β isPropΞ Ξ» _ β isprop _) (ind f))
helper (suc (suc zero)) isprop ind f =
trElim (Ξ» _ β isOfHLevelPlus {n = 1} 4 (isPropΞ Ξ» _ β isprop _))
(suspToPropElim north (Ξ» _ β isPropΞ Ξ» _ β isprop _) (ind f))
helper (suc (suc (suc n))) isprop ind f =
trElim (Ξ» _ β isOfHLevelPlus' {n = 5 + n} 1 (isPropΞ Ξ» _ β isprop _))
(suspToPropElim north (Ξ» _ β isPropΞ Ξ» _ β isprop _) (ind f))
coHomPointedElim2 : {A : Type β} (n : β) (a : A) {B : coHom (suc n) A β coHom (suc n) A β Type β'}
β ((x y : coHom (suc n) A) β isProp (B x y))
β ((f g : A β coHomK (suc n)) β f a β‘ coHom-pt (suc n) β g a β‘ coHom-pt (suc n) β B β£ f β£β β£ g β£β)
β (x y : coHom (suc n) A) β B x y
coHomPointedElim2 {β' = β'} {A = A} n a isprop indp = sElim2 (Ξ» _ _ β isOfHLevelSuc 1 (isprop _ _))
Ξ» f g β helper n a isprop indp f g (f a) (g a) refl refl
where
helper : (n : β) (a : A) {B : coHom (suc n) A β coHom (suc n) A β Type β'}
β ((x y : coHom (suc n) A) β isProp (B x y))
β ((f g : A β coHomK (suc n)) β f a β‘ coHom-pt (suc n) β g a β‘ coHom-pt (suc n) β B β£ f β£β β£ g β£β)
β (f g : A β coHomK (suc n))
β (x y : coHomK (suc n))
β f a β‘ x β g a β‘ y
β B β£ f β£β β£ g β£β
helper zero a isprop indp f g =
elim2 (Ξ» _ _ β isOfHLevelPlus {n = 1} 2 (isPropΞ 2 Ξ» _ _ β isprop _ _))
(toPropElim2 (Ξ» _ _ β isPropΞ 2 Ξ» _ _ β isprop _ _) (indp f g))
helper (suc zero) a isprop indp f g =
elim2 (Ξ» _ _ β isOfHLevelPlus {n = 1} 3 (isPropΞ 2 Ξ» _ _ β isprop _ _))
(suspToPropElim2 base (Ξ» _ _ β isPropΞ 2 Ξ» _ _ β isprop _ _) (indp f g))
helper (suc (suc zero)) a isprop indp f g =
elim2 (Ξ» _ _ β isOfHLevelPlus {n = 1} 4 (isPropΞ 2 Ξ» _ _ β isprop _ _))
(suspToPropElim2 north (Ξ» _ _ β isPropΞ 2 Ξ» _ _ β isprop _ _) (indp f g))
helper (suc (suc (suc n))) a isprop indp f g =
elim2 (Ξ» _ _ β isOfHLevelPlus' {n = 5 + n} 1 (isPropΞ 2 Ξ» _ _ β isprop _ _))
(suspToPropElim2 north (Ξ» _ _ β isPropΞ 2 Ξ» _ _ β isprop _ _) (indp f g))
coHomK-elim : β {β} (n : β) {B : coHomK (suc n) β Type β}
β ((x : _) β isOfHLevel (suc n) (B x))
β B (0β (suc n))
β (x : _) β B x
coHomK-elim n {B = B } hlev b =
trElim (Ξ» _ β isOfHLevelPlus {n = (suc n)} 2 (hlev _))
(sphereElim _ (hlev β β£_β£) b)
{- Equivalence between cohomology of A and reduced cohomology of (A + 1) -}
coHomRed+1Equiv : (n : β) β
(A : Type β) β
(coHom n A) β‘ (coHomRed n ((A β Unit , inr (tt))))
coHomRed+1Equiv zero A i = β₯ helpLemma {C = (Int , pos 0)} i β₯β
module coHomRed+1 where
helpLemma : {C : Pointed β} β ( (A β (typ C)) β‘ ((((A β Unit) , inr (tt)) ββ C)))
helpLemma {C = C} = isoToPath (iso map1
map2
(Ξ» b β linvPf b)
(Ξ» _ β refl))
where
map1 : (A β typ C) β ((((A β Unit) , inr (tt)) ββ C))
map1 f = map1' , refl
module helpmap where
map1' : A β Unit β fst C
map1' (inl x) = f x
map1' (inr x) = pt C
map2 : ((((A β Unit) , inr (tt)) ββ C)) β (A β typ C)
map2 (g , pf) x = g (inl x)
linvPf : (b :((((A β Unit) , inr (tt)) ββ C))) β map1 (map2 b) β‘ b
linvPf (f , snd) i = (Ξ» x β helper x i) , Ξ» j β snd ((~ i) β¨ j)
where
helper : (x : A β Unit) β ((helpmap.map1') (map2 (f , snd)) x) β‘ f x
helper (inl x) = refl
helper (inr tt) = sym snd
coHomRed+1Equiv (suc zero) A i = β₯ coHomRed+1.helpLemma A i {C = (coHomK 1 , β£ base β£)} i β₯β
coHomRed+1Equiv (suc (suc n)) A i = β₯ coHomRed+1.helpLemma A i {C = (coHomK (2 + n) , β£ north β£)} i β₯β
Iso-coHom-coHomRed : β {β} {A : Pointed β} (n : β) β Iso (coHomRed (suc n) A) (coHom (suc n) (typ A))
fun (Iso-coHom-coHomRed {A = A , a} n) = map fst
inv' (Iso-coHom-coHomRed {A = A , a} n) = map Ξ» f β (Ξ» x β f x -β f a) , rCancelβ _ _
rightInv (Iso-coHom-coHomRed {A = A , a} n) =
sElim (Ξ» _ β isOfHLevelPath 2 Β§ _ _)
Ξ» f β trRec (isPropβisOfHLevelSuc _ (Β§ _ _))
(Ξ» p β cong β£_β£β (funExt Ξ» x β cong (Ξ» y β f x +β y) (cong -β_ p β -0β) β rUnitβ _ (f x)))
(Iso.fun (PathIdTruncIso (suc n)) (isContrβisProp (isConnectedKn n) β£ f a β£ β£ 0β _ β£))
leftInv (Iso-coHom-coHomRed {A = A , a} n) =
sElim (Ξ» _ β isOfHLevelPath 2 Β§ _ _)
Ξ» {(f , p) β cong β£_β£β (Ξ£PathP (((funExt Ξ» x β (cong (Ξ» y β f x -β y) p
ββ cong (Ξ» y β f x +β y) -0β
ββ rUnitβ _ (f x)) β refl))
, helper n (f a) (sym p)))}
where
path : (n : β) (x : coHomK (suc n)) (p : 0β _ β‘ x) β _
path n x p = (cong (Ξ» y β x -β y) (sym p) ββ cong (Ξ» y β x +β y) -0β ββ rUnitβ _ x) β refl
helper : (n : β) (x : coHomK (suc n)) (p : 0β _ β‘ x)
β PathP (Ξ» i β path n x p i β‘ 0β _) (rCancelβ _ x) (sym p)
helper zero x =
J (Ξ» x p β PathP (Ξ» i β path 0 x p i β‘ 0β _)
(rCancelβ _ x) (sym p))
Ξ» i j β rUnit (rUnit (Ξ» _ β 0β 1) (~ j)) (~ j) i
helper (suc n) x =
J (Ξ» x p β PathP (Ξ» i β path (suc n) x p i β‘ 0β _) (rCancelβ _ x) (sym p))
Ξ» i j β rCancelβ (suc (suc n)) (0β (suc (suc n))) (~ i β§ ~ j)
+ββ‘+ : (n : β) {A : Pointed β} (x y : coHomRed (suc n) A)
β Iso.fun (Iso-coHom-coHomRed n) (x +ββ y)
β‘ Iso.fun (Iso-coHom-coHomRed n) x +β Iso.fun (Iso-coHom-coHomRed n) y
+ββ‘+ zero = sElim2 (Ξ» _ _ β isOfHLevelPath 2 Β§ _ _) Ξ» _ _ β refl
+ββ‘+ (suc n) = sElim2 (Ξ» _ _ β isOfHLevelPath 2 Β§ _ _) Ξ» _ _ β refl
private
homhelp : β {β} (n : β) (A : Pointed β) (x y : coHom (suc n) (typ A))
β Iso.inv (Iso-coHom-coHomRed {A = A} n) (x +β y)
β‘ Iso.inv (Iso-coHom-coHomRed n) x +ββ Iso.inv (Iso-coHom-coHomRed n) y
homhelp n A = morphLemmas.isMorphInv _+ββ_ _+β_
(Iso.fun (Iso-coHom-coHomRed n)) (+ββ‘+ n) _
(Iso.rightInv (Iso-coHom-coHomRed n)) (Iso.leftInv (Iso-coHom-coHomRed n))
coHomGrβ
coHomRedGr : β {β} (n : β) (A : Pointed β)
β GroupEquiv (coHomRedGrDir (suc n) A) (coHomGr (suc n) (typ A))
fst (coHomGrβ
coHomRedGr n A) = isoToEquiv (Iso-coHom-coHomRed n)
snd (coHomGrβ
coHomRedGr n A) = makeIsGroupHom (+ββ‘+ n)
coHomRedGroup : β {β} (n : β) (A : Pointed β) β AbGroup β
coHomRedGroup zero A = coHomRedGroupDir zero A
coHomRedGroup (suc n) A =
InducedAbGroup (coHomGroup (suc n) (typ A))
_+ββ_
(isoToEquiv (invIso (Iso-coHom-coHomRed n)))
(homhelp n A)
abstract
coHomGroupβ‘coHomRedGroup : β {β} (n : β) (A : Pointed β)
β coHomGroup (suc n) (typ A) β‘ coHomRedGroup (suc n) A
coHomGroupβ‘coHomRedGroup n A =
InducedAbGroupPath (coHomGroup (suc n) (typ A))
_+ββ_
(isoToEquiv (invIso (Iso-coHom-coHomRed n)))
(homhelp n A)
------------------- Kβ β Ξ©Kβββ ---------------------
-- This proof uses the encode-decode method rather than Freudenthal
-- We define the map Ο : Kβ β Ξ©Kβββ and prove that it is a morphism
private
module _ (n : β) where
Ο : {n : β} β coHomK (suc n) β Path (coHomK (2 + n)) β£ north β£ β£ north β£
Ο {n = n} = trRec (isOfHLevelTrunc (4 + n) _ _)
Ξ» a β cong β£_β£ (merid a β sym (merid (ptSn (suc n))))
Ο-hom-helper : β {β} {A : Type β} {a : A} (p : a β‘ a) (r : refl β‘ p)
β lUnit p β cong (_β p) r β‘ rUnit p β cong (p β_) r
Ο-hom-helper p = J (Ξ» p r β lUnit p β cong (_β p) r β‘ rUnit p β cong (p β_) r) refl
Ο-hom : {n : β} (x y : coHomK (suc n)) β Ο (x +β y) β‘ Ο x β Ο y
Ο-hom {n = zero} =
elim2 (Ξ» _ _ β isOfHLevelPath 3 (isOfHLevelTrunc 4 _ _) _ _)
(wedgeconFun _ _
(Ξ» _ _ β isOfHLevelTrunc 4 _ _ _ _)
(Ξ» x β lUnit _
β cong (_β Ο β£ x β£) (cong (cong β£_β£) (sym (rCancel (merid base)))))
(Ξ» y β cong Ο (rUnitβ 1 β£ y β£)
ββ rUnit _
ββ cong (Ο β£ y β£ β_) (cong (cong β£_β£) (sym (rCancel (merid base)))))
(sym (Ο-hom-helper (Ο β£ base β£) (cong (cong β£_β£) (sym (rCancel (merid base)))))))
Ο-hom {n = suc n} =
elim2 (Ξ» _ _ β isOfHLevelPath (4 + n) (isOfHLevelTrunc (5 + n) _ _) _ _)
(wedgeconFun _ _ (Ξ» _ _ β isOfHLevelPath ((2 + n) + (2 + n)) (wedgeConHLev' n) _ _)
(Ξ» x β lUnit _
β cong (_β Ο β£ x β£) (cong (cong β£_β£) (sym (rCancel (merid north)))))
(Ξ» y β cong Ο (rUnitβ (2 + n) β£ y β£)
ββ rUnit _
ββ cong (Ο β£ y β£ β_) (cong (cong β£_β£) (sym (rCancel (merid north)))))
(sym (Ο-hom-helper (Ο β£ north β£) (cong (cong β£_β£) (sym (rCancel (merid north)))))))
-- We will need to following lemma
Ο-minusDistr : {n : β} (x y : coHomK (suc n)) β Ο (x -β y) β‘ Ο x β sym (Ο y)
Ο-minusDistr {n = n} =
morphLemmas.distrMinus'
_+β_ _β_
Ο Ο-hom β£ (ptSn (suc n)) β£ refl
-β_ sym
(Ξ» x β sym (lUnit x)) (Ξ» x β sym (rUnit x))
(rUnitβ (suc n))
(lCancelβ (suc n)) rCancel
(assocβ (suc n)) assocβ
(cong (cong β£_β£) (rCancel (merid (ptSn (suc n)))))
-- we define the code using addIso
Code : (n : β) β coHomK (2 + n) β Typeβ
Code n x = (trRec {B = TypeOfHLevel β-zero (3 + n)} (isOfHLevelTypeOfHLevel (3 + n))
Ξ» a β Code' a , hLevCode' a) x .fst
where
Code' : (Sβ (2 + n)) β Typeβ
Code' north = coHomK (suc n)
Code' south = coHomK (suc n)
Code' (merid a i) = isoToPath (addIso (suc n) β£ a β£) i
hLevCode' : (x : Sβ (2 + n)) β isOfHLevel (3 + n) (Code' x)
hLevCode' = suspToPropElim (ptSn (suc n)) (Ξ» _ β isPropIsOfHLevel (3 + n)) (isOfHLevelTrunc (3 + n))
symMeridLem : (n : β) β (x : Sβ (suc n)) (y : coHomK (suc n))
β subst (Code n) (cong β£_β£ (sym (merid x))) y β‘ y -β β£ x β£
symMeridLem n x = trElim (Ξ» _ β isOfHLevelPath (3 + n) (isOfHLevelTrunc (3 + n)) _ _)
(Ξ» y β cong (_-β β£ x β£) (transportRefl β£ y β£))
decode : {n : β} (x : coHomK (2 + n)) β Code n x β β£ north β£ β‘ x
decode {n = n} = trElim (Ξ» _ β isOfHLevelΞ (4 + n) Ξ» _ β isOfHLevelPath (4 + n) (isOfHLevelTrunc (4 + n)) _ _)
decode-elim
where
northβ‘merid : (a : Sβ (suc n))
β Path (coHomK (2 + n)) β£ north β£ β£ north β£
β‘ (Path (coHomK (2 + n)) β£ north β£ β£ south β£)
northβ‘merid a i = Path (coHomK (2 + n)) β£ north β£ β£ merid a i β£
decode-elim : (a : Sβ (2 + n)) β Code n β£ a β£ β Path (coHomK (2 + n)) β£ north β£ β£ a β£
decode-elim north = Ο
decode-elim south = trRec (isOfHLevelTrunc (4 + n) _ _)
Ξ» a β cong β£_β£ (merid a)
decode-elim (merid a i) =
hcomp (Ξ» k β Ξ» { (i = i0) β Ο
; (i = i1) β mainPath a k})
(funTypeTransp (Code n) (Ξ» x β β£ north β£ β‘ x) (cong β£_β£ (merid a)) Ο i)
where
mainPath : (a : (Sβ (suc n))) β
transport (northβ‘merid a) β Ο β transport (Ξ» i β Code n β£ merid a (~ i) β£)
β‘ trRec (isOfHLevelTrunc (4 + n) _ _) Ξ» a β cong β£_β£ (merid a)
mainPath a = funExt (trElim (Ξ» _ β isOfHLevelPath (3 + n) (isOfHLevelTrunc (4 + n) _ _) _ _)
(Ξ» x β (Ξ» i β transport (northβ‘merid a) (Ο (symMeridLem n a β£ x β£ i)))
ββ cong (transport (northβ‘merid a)) (-distrHelp x)
ββ (substAbove x)))
where
-distrHelp : (x : Sβ (suc n)) β Ο (β£ x β£ -β β£ a β£) β‘ cong β£_β£ (merid x) β cong β£_β£ (sym (merid a))
-distrHelp x =
Ο-minusDistr β£ x β£ β£ a β£
β (Ξ» i β (cong β£_β£ (compPath-filler (merid x) (Ξ» j β merid (ptSn (suc n)) (~ j β¨ i)) (~ i)))
β (cong β£_β£ (sym (compPath-filler (merid a) (Ξ» j β merid (ptSn (suc n)) (~ j β¨ i)) (~ i)))))
substAbove : (x : Sβ (suc n)) β transport (northβ‘merid a) (cong β£_β£ (merid x) β cong β£_β£ (sym (merid a)))
β‘ cong β£_β£ (merid x)
substAbove x i = transp (Ξ» j β northβ‘merid a (i β¨ j)) i
(compPath-filler (cong β£_β£ (merid x)) (Ξ» j β β£ merid a (~ j β¨ i) β£) (~ i))
encode : {n : β} {x : coHomK (2 + n)} β Path (coHomK (2 + n)) β£ north β£ x β Code n x
encode {n = n} p = transport (cong (Code n) p) β£ (ptSn (suc n)) β£
decode-encode : {n : β} {x : coHomK (2 + n)} (p : Path (coHomK (2 + n)) β£ north β£ x)
β decode _ (encode p) β‘ p
decode-encode {n = n} =
J (Ξ» y p β decode _ (encode p) β‘ p)
(cong (decode β£ north β£) (transportRefl β£ ptSn (suc n) β£)
β cong (cong β£_β£) (rCancel (merid (ptSn (suc n)))))
-- We define an addition operation on Code which we can use in order to show that encode is a
-- morphism (in a very loose sense)
hLevCode : {n : β} (x : coHomK (2 + n)) β isOfHLevel (3 + n) (Code n x)
hLevCode {n = n} =
trElim (Ξ» _ β isPropβisOfHLevelSuc (3 + n) (isPropIsOfHLevel (3 + n)))
(sphereToPropElim _
(Ξ» _ β (isPropIsOfHLevel (3 + n))) (isOfHLevelTrunc (3 + n)))
Code-add' : {n : β} (x : _) β Code n β£ north β£ β Code n β£ x β£ β Code n β£ x β£
Code-add' {n = n} north = _+β_
Code-add' {n = n} south = _+β_
Code-add' {n = n} (merid a i) = helper n a i
where
help : (n : β) β (x y a : Sβ (suc n))
β transport (Ξ» i β Code n β£ north β£ β Code n β£ merid a i β£ β Code n β£ merid a i β£)
(_+β_) β£ x β£ β£ y β£
β‘ β£ x β£ +β β£ y β£
help n x y a =
(Ξ» i β transportRefl ((β£ transportRefl x i β£ +β (β£ transportRefl y i β£ -β β£ a β£)) +β β£ a β£) i)
ββ cong (_+β β£ a β£) (assocβ _ β£ x β£ β£ y β£ (-β β£ a β£))
ββ sym (assocβ _ (β£ x β£ +β β£ y β£) (-β β£ a β£) β£ a β£)
ββ cong ((β£ x β£ +β β£ y β£) +β_) (lCancelβ _ β£ a β£)
ββ rUnitβ _ _
helper : (n : β) (a : Sβ (suc n))
β PathP (Ξ» i β Code n β£ north β£ β Code n β£ merid a i β£ β Code n β£ merid a i β£) _+β_ _+β_
helper n a =
toPathP (funExt
(trElim (Ξ» _ β isOfHLevelPath (3 + n) (isOfHLevelΞ (3 + n) (Ξ» _ β isOfHLevelTrunc (3 + n))) _ _)
Ξ» x β funExt
(trElim (Ξ» _ β isOfHLevelPath (3 + n) (isOfHLevelTrunc (3 + n)) _ _)
Ξ» y β help n x y a)))
Code-add : {n : β} (x : _) β Code n β£ north β£ β Code n x β Code n x
Code-add {n = n} =
trElim (Ξ» x β isOfHLevelΞ (4 + n) Ξ» _ β isOfHLevelΞ (4 + n) Ξ» _ β isOfHLevelSuc (3 + n) (hLevCode {n = n} x))
Code-add'
encode-hom : {n : β} {x : _} (q : 0β _ β‘ 0β _) (p : 0β _ β‘ x)
β encode (q β p) β‘ Code-add {n = n} x (encode q) (encode p)
encode-hom {n = n} q = J (Ξ» x p β encode (q β p) β‘ Code-add {n = n} x (encode q) (encode p))
(cong encode (sym (rUnit q))
ββ sym (rUnitβ _ (encode q))
ββ cong (encode q +β_) (cong β£_β£ (sym (transportRefl _))))
stabSpheres : (n : β) β Iso (coHomK (suc n)) (typ (Ξ© (coHomK-ptd (2 + n))))
fun (stabSpheres n) = decode _
inv' (stabSpheres n) = encode
rightInv (stabSpheres n) p = decode-encode p
leftInv (stabSpheres n) =
trElim (Ξ» _ β isOfHLevelPath (3 + n) (isOfHLevelTrunc (3 + n)) _ _)
Ξ» a β cong encode (congFunct β£_β£ (merid a) (sym (merid (ptSn (suc n)))))
ββ (Ξ» i β transport (congFunct (Code n) (cong β£_β£ (merid a))
(cong β£_β£ (sym (merid (ptSn (suc n))))) i) β£ ptSn (suc n) β£)
ββ (substComposite (Ξ» x β x)
(cong (Code n) (cong β£_β£ (merid a)))
(cong (Code n) (cong β£_β£ (sym (merid (ptSn (suc n)))))) β£ ptSn (suc n) β£
ββ cong (transport (Ξ» i β Code n β£ merid (ptSn (suc n)) (~ i) β£))
(transportRefl (β£ (ptSn (suc n)) β£ +β β£ a β£) β lUnitβ (suc n) β£ a β£)
ββ symMeridLem n (ptSn (suc n)) β£ a β£
ββ cong (β£ a β£ +β_) -0β
ββ rUnitβ (suc n) β£ a β£)
Iso-Kn-Ξ©Kn+1 : (n : HLevel) β Iso (coHomK n) (typ (Ξ© (coHomK-ptd (suc n))))
Iso-Kn-Ξ©Kn+1 zero = invIso (compIso (congIso (truncIdempotentIso _ isGroupoidSΒΉ)) Ξ©SΒΉIsoInt)
Iso-Kn-Ξ©Kn+1 (suc n) = stabSpheres n
KnβΞ©Kn+1 : {n : β} β coHomK n β typ (Ξ© (coHomK-ptd (suc n)))
KnβΞ©Kn+1 {n = n} = isoToEquiv (Iso-Kn-Ξ©Kn+1 n)
-- Some properties of the Iso
KnβΞ©Kn+1 : (n : β) β coHomK n β typ (Ξ© (coHomK-ptd (suc n)))
KnβΞ©Kn+1 n = Iso.fun (Iso-Kn-Ξ©Kn+1 n)
Ξ©Kn+1βKn : (n : β) β typ (Ξ© (coHomK-ptd (suc n))) β coHomK n
Ξ©Kn+1βKn n = Iso.inv (Iso-Kn-Ξ©Kn+1 n)
KnβΞ©Kn+10β : (n : β) β KnβΞ©Kn+1 n (0β n) β‘ refl
KnβΞ©Kn+10β zero = sym (rUnit refl)
KnβΞ©Kn+10β (suc n) i j = β£ (rCancel (merid (ptSn (suc n))) i j) β£
Ξ©Kn+1βKn-refl : (n : β) β Ξ©Kn+1βKn n refl β‘ 0β n
Ξ©Kn+1βKn-refl zero = refl
Ξ©Kn+1βKn-refl (suc zero) = refl
Ξ©Kn+1βKn-refl (suc (suc n)) = refl
KnβΞ©Kn+1-hom : (n : β) (x y : coHomK n) β KnβΞ©Kn+1 n (x +[ n ]β y) β‘ KnβΞ©Kn+1 n x β KnβΞ©Kn+1 n y
KnβΞ©Kn+1-hom zero x y = (Ξ» j i β hfill (doubleComp-faces (Ξ» iβ β β£ base β£) (Ξ» _ β β£ base β£) i)
(inS (β£ intLoop (x β€+ y) i β£)) (~ j))
ββ (Ξ» j i β β£ intLoop-hom x y (~ j) i β£)
ββ (congFunct β£_β£ (intLoop x) (intLoop y)
β congβ _β_ (Ξ» j i β hfill (doubleComp-faces (Ξ» iβ β β£ base β£) (Ξ» _ β β£ base β£) i)
(inS (β£ intLoop x i β£)) j)
Ξ» j i β hfill (doubleComp-faces (Ξ» iβ β β£ base β£) (Ξ» _ β β£ base β£) i)
(inS (β£ intLoop y i β£)) j)
KnβΞ©Kn+1-hom (suc n) = Ο-hom
Ξ©Kn+1βKn-hom : (n : β) (x y : Path (coHomK (suc n)) (0β _) (0β _))
β Ξ©Kn+1βKn n (x β y) β‘ Ξ©Kn+1βKn n x +[ n ]β Ξ©Kn+1βKn n y
Ξ©Kn+1βKn-hom zero p q =
cong winding (congFunct (trRec isGroupoidSΒΉ (Ξ» x β x)) p q)
β winding-hom (cong (trRec isGroupoidSΒΉ (Ξ» x β x)) p) (cong (trRec isGroupoidSΒΉ (Ξ» x β x)) q)
Ξ©Kn+1βKn-hom (suc n) = encode-hom
isHomogeneousKn : (n : HLevel) β isHomogeneous (coHomK-ptd n)
isHomogeneousKn n =
subst isHomogeneous
(sym (Ξ£PathP (ua KnβΞ©Kn+1 , ua-gluePath _ (KnβΞ©Kn+10β n))))
(isHomogeneousPath _ _)
-- With the equivalence KnβΞ©Kn+1, we get that the two definitions of cohomology groups agree
open IsGroupHom
coHomβ
coHomΞ© : β {β} (n : β) (A : Type β) β GroupIso (coHomGr n A) (coHomGrΞ© n A)
fun (fst (coHomβ
coHomΞ© n A)) = map Ξ» f a β KnβΞ©Kn+1 n (f a)
inv' (fst (coHomβ
coHomΞ© n A)) = map Ξ» f a β Ξ©Kn+1βKn n (f a)
rightInv (fst (coHomβ
coHomΞ© n A)) =
sElim (Ξ» _ β isOfHLevelPath 2 Β§ _ _)
Ξ» f β cong β£_β£β (funExt Ξ» x β rightInv (Iso-Kn-Ξ©Kn+1 n) (f x))
leftInv (fst (coHomβ
coHomΞ© n A)) =
sElim (Ξ» _ β isOfHLevelPath 2 Β§ _ _)
Ξ» f β cong β£_β£β (funExt Ξ» x β leftInv (Iso-Kn-Ξ©Kn+1 n) (f x))
snd (coHomβ
coHomΞ© n A) =
makeIsGroupHom
(sElim2 (Ξ» _ _ β isOfHLevelPath 2 Β§ _ _)
Ξ» f g β cong β£_β£β (funExt Ξ» x β KnβΞ©Kn+1-hom n (f x) (g x)))
module lockedKnIso (key : Unit') where
KnβΞ©Kn+1' : (n : β) β coHomK n β typ (Ξ© (coHomK-ptd (suc n)))
KnβΞ©Kn+1' n = lock key (Iso.fun (Iso-Kn-Ξ©Kn+1 n))
Ξ©Kn+1βKn' : (n : β) β typ (Ξ© (coHomK-ptd (suc n))) β coHomK n
Ξ©Kn+1βKn' n = lock key (Iso.inv (Iso-Kn-Ξ©Kn+1 n))
Ξ©Kn+1βKnβΞ©Kn+1 : (n : β) β (x : typ (Ξ© (coHomK-ptd (suc n)))) β KnβΞ©Kn+1' n (Ξ©Kn+1βKn' n x) β‘ x
Ξ©Kn+1βKnβΞ©Kn+1 n x = pm key
where
pm : (key : Unit') β lock key (Iso.fun (Iso-Kn-Ξ©Kn+1 n)) (lock key (Iso.inv (Iso-Kn-Ξ©Kn+1 n)) x) β‘ x
pm unlock = Iso.rightInv (Iso-Kn-Ξ©Kn+1 n) x
KnβΞ©Kn+1βKn : (n : β) β (x : coHomK n) β Ξ©Kn+1βKn' n (KnβΞ©Kn+1' n x) β‘ x
KnβΞ©Kn+1βKn n x = pm key
where
pm : (key : Unit') β lock key (Iso.inv (Iso-Kn-Ξ©Kn+1 n)) (lock key (Iso.fun (Iso-Kn-Ξ©Kn+1 n)) x) β‘ x
pm unlock = Iso.leftInv (Iso-Kn-Ξ©Kn+1 n) x
-distrLemma : β {β β'} {A : Type β} {B : Type β'} (n m : β) (f : GroupHom (coHomGr n A) (coHomGr m B))
(x y : coHom n A)
β fst f (x -[ n ]β y) β‘ fst f x -[ m ]β fst f y
-distrLemma n m f' x y = sym (-cancelRβ m (f y) (f (x -[ n ]β y)))
ββ cong (Ξ» x β x -[ m ]β f y) (sym (f' .snd .presΒ· (x -[ n ]β y) y))
ββ cong (Ξ» x β x -[ m ]β f y) ( cong f (-+cancelβ n _ _))
where
f = fst f'
|
Require Import Coq.micromega.Lia.
Require Import Coq.NArith.NArith.
Module N.
Lemma testbit_ones n i : N.testbit (N.ones n) i = N.ltb i n.
Proof using Type.
pose proof N.ones_spec_iff n i.
destruct (N.testbit _ _) eqn:? in*; destruct (N.ltb_spec i n); trivial.
{ pose proof (proj1 H eq_refl); lia. }
{ pose proof (proj2 H H0). inversion H1. }
Qed.
Lemma ones_min m n : N.ones (N.min m n) = N.land (N.ones m) (N.ones n).
Proof using Type.
eapply N.bits_inj_iff; intro i.
rewrite N.land_spec.
rewrite !N.testbit_ones.
destruct (N.ltb_spec0 i (N.min m n));
destruct (N.ltb_spec0 i m);
destruct (N.ltb_spec0 i n);
try reflexivity;
lia.
Qed.
End N.
|
It doesnβt quite feel like summer in Seattle until the fourth of July. This weekend in the 80β²s confirmed it. Thursday night kick off after work celebrating Markyβs birthday with beers and Thai food with his family. Friday morning brunch at our house with ZoΓ« and Eric over. Paper shopping and a facial at U-Village. Surprise sneak peak of fireworks at home. Saturday was errands, running into Val at Elliott Bay, crafting Ernelynβs gift, followed by amazing evening at Dahlia Lounge celebrating her 40th birthday with family. Sunday was dim sum with Jules, doing chores around the house, naps, mass, and then pizza dinner with Courtney and Sean at Z & Eβs rooftop as the sun set. All while Lincoln crawled, screeched, laughed, kept us up late, played, impressed, and generally became a major handful. It was a good long weekend. |
/-
Copyright (c) 2022 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Lean
import Mathlib.Tactic.OpenPrivate
import Mathlib.Data.List.Defs
/-!
# Backward compatible implementation of lean 3 `cases` tactic
This tactic is similar to the `cases` tactic in lean 4 core, but the syntax for giving
names is different:
```
example (h : p β¨ q) : q β¨ p := by
cases h with
| inl hp => exact Or.inr hp
| inr hq => exact Or.inl hq
example (h : p β¨ q) : q β¨ p := by
cases' h with hp hq
Β· exact Or.inr hp
Β· exact Or.inl hq
example (h : p β¨ q) : q β¨ p := by
rcases h with hp | hq
Β· exact Or.inr hp
Β· exact Or.inl hq
```
Prefer `cases` or `rcases` when possible, because these tactics promote structured proofs.
-/
namespace Lean.Parser.Tactic
open Meta Elab Elab.Tactic
open private getAltNumFields in evalCases ElimApp.evalAlts.go in
def ElimApp.evalNames (elimInfo : ElimInfo) (alts : Array (Name Γ MVarId)) (withArg : Syntax)
(numEqs := 0) (numGeneralized := 0) (toClear : Array FVarId := #[]) :
TermElabM (Array MVarId) := do
let mut names := if withArg.isNone then [] else
withArg[1].getArgs.map (getNameOfIdent' Β·[0]) |>.toList
let mut subgoals := #[]
for (altName, g) in alts do
let numFields β getAltNumFields elimInfo altName
let (altVarNames, names') := names.splitAtD numFields `_
names := names'
let (_, g) β introN g numFields altVarNames
let some (g, _) β Cases.unifyEqs numEqs g {} | pure ()
let (_, g) β introNP g numGeneralized
let g β liftM $ toClear.foldlM tryClear g
subgoals := subgoals.push g
pure subgoals
open private getElimNameInfo generalizeTargets generalizeVars in evalInduction in
elab (name := induction') tk:"induction' " tgts:(casesTarget,+)
usingArg:(" using " ident)?
withArg:(" with " (colGt binderIdent)+)?
genArg:(" generalizing " (colGt ident)+)? : tactic => do
let targets β elabCasesTargets tgts.getSepArgs
let (elimName, elimInfo) β getElimNameInfo usingArg targets (induction := true)
let g β getMainGoal
withMVarContext g do
let targets β addImplicitTargets elimInfo targets
evalInduction.checkTargets targets
let targetFVarIds := targets.map (Β·.fvarId!)
withMVarContext g do
let genArgs β if genArg.isNone then pure #[] else getFVarIds genArg[1].getArgs
let forbidden β mkGeneralizationForbiddenSet targets
let mut s β getFVarSetToGeneralize targets forbidden
for v in genArgs do
if forbidden.contains v then
throwError "variable cannot be generalized because target depends on it{indentExpr (mkFVar v)}"
if s.contains v then
throwError "unnecessary 'generalizing' argument, variable '{mkFVar v}' is generalized automatically"
s := s.insert v
let (fvarIds, g) β Meta.revert g (β sortFVarIds s.toArray)
let result β withRef tgts <| ElimApp.mkElimApp elimName elimInfo targets (β getMVarTag g)
let elimArgs := result.elimApp.getAppArgs
ElimApp.setMotiveArg g elimArgs[elimInfo.motivePos].mvarId! targetFVarIds
assignExprMVar g result.elimApp
let subgoals β ElimApp.evalNames elimInfo result.alts withArg
(numGeneralized := fvarIds.size) (toClear := targetFVarIds)
setGoals (subgoals ++ result.others).toList
open private getElimNameInfo in evalCases in
elab (name := cases') "cases' " tgts:(casesTarget,+) usingArg:(" using " ident)?
withArg:(" with " (colGt binderIdent)+)? : tactic => do
let targets β elabCasesTargets tgts.getSepArgs
let (elimName, elimInfo) β getElimNameInfo usingArg targets (induction := false)
let g β getMainGoal
withMVarContext g do
let targets β addImplicitTargets elimInfo targets
let result β withRef tgts <| ElimApp.mkElimApp elimName elimInfo targets (β getMVarTag g)
let elimArgs := result.elimApp.getAppArgs
let targets β elimInfo.targetsPos.mapM (instantiateMVars elimArgs[Β·])
let motive := elimArgs[elimInfo.motivePos]
let g β generalizeTargetsEq g (β inferType motive) targets
let (targetsNew, g) β introN g targets.size
withMVarContext g do
ElimApp.setMotiveArg g motive.mvarId! targetsNew
assignExprMVar g result.elimApp
let subgoals β ElimApp.evalNames elimInfo result.alts withArg
(numEqs := targets.size) (toClear := targetsNew)
setGoals subgoals.toList
|
function pseudo_marginal_full(prng, data, choices, scale, ΟΒ², ϡ², βΒ², u)
#=
Filippone, Maurizio, and Mark Girolami.
"Pseudo-marginal Bayesian inference for Gaussian processes."
IEEE Transactions on Pattern Analysis and Machine Intelligence (2014)
=##
try
K = compute_gram_matrix(data, ΟΒ², ϡ², βΒ²)
K = PDMats.PDMat(K)
ΞΌ, Ξ£, a, B = laplace_approximation(K, choices, zeros(length(u)), scale;
verbose=false)
Ξ£ = PDMats.PDMat(Ξ£)
q = MvNormal(ΞΌ, Ξ£)
f_sample = PDMats.unwhiten(q.Ξ£, u) + q.ΞΌ
joint = logjointlike(K, choices, f_sample, scale)
logpml = joint - logpdf(q, f_sample)
return logpml, f_sample, q, K, Ξ£, a
catch err
# if(isa(err, LinearAlgebra.PosDefException))
# @warn "Cholesky failed. Rejecting proposal"
# return -Inf, nothing, nothing, nothing, nothing, nothing
# else
# throw(err)
# end
@warn "Cholesky or determinant failed. Rejecting proposal"
return -Inf, nothing, nothing, nothing, nothing, nothing
end
end
@inline function pseudo_marginal_partial(prng, choices, q, K, scale, u)
#=
Filippone, Maurizio, and Mark Girolami.
"Pseudo-marginal Bayesian inference for Gaussian processes."
IEEE Transactions on Pattern Analysis and Machine Intelligence (2014)
=##
f_sample = PDMats.unwhiten(q.Ξ£, u) + q.ΞΌ
joint = logjointlike(K, choices, f_sample, scale)
logpml = joint - logpdf(q, f_sample)
logpml
end
function ess_transition(prng, loglike, prev_ΞΈ, prev_like, prior)
#=
Murray, Iain, Ryan Adams, and David MacKay.
"Elliptical slice sampling."
Artificial Intelligence and Statistics. 2010.
=##
@label propose
chol_fail = 0
Ξ½ = rand(prng, prior)
ΞΌ = mean(prior)
u = rand(prng)
logy = prev_like + log(u)
Ο΅ = rand(prng)*2*Ο
Ο΅_min = Ο΅ - 2*Ο
Ο΅_max = deepcopy(Ο΅)
proposals = 1
while(true)
cosΟ΅ = cos(Ο΅)
sinΟ΅ = sin(Ο΅)
a = 1 - (cosΟ΅ + sinΟ΅)
prop_ΞΈ = @. cosΟ΅*prev_ΞΈ + sinΟ΅*Ξ½ + a*ΞΌ
prop_logp = loglike(prop_ΞΈ)
if(isinf(prop_logp))
chol_fail += 1
if(chol_fail > 10)
throw(LinearAlgebra.PosDefException(1))
end
@goto propose
end
if(prop_logp > logy)
return prop_ΞΈ, prop_logp, proposals
else
if(Ο΅ < 0)
Ο΅_min = deepcopy(Ο΅)
else
Ο΅_max = deepcopy(Ο΅)
end
Ο΅ = rand(prng, Uniform(Ο΅_min, Ο΅_max))
proposals += 1
end
end
end
function pm_ess(prng,
samples::Int,
warmup::Int,
thinning::Int,
initial_ΞΈ::Vector{<:Real},
initial_f::Vector{<:Real},
prior,
scale::Real,
data::Matrix{<:Real},
choices::Matrix{<:Int})
#=
Murray, Iain, and Matthew Graham.
Pseudo-marginal slice sampling.
Artificial Intelligence and Statistics. 2016.
=##
ΞΈ_samples = zeros(length(initial_ΞΈ), samples)
f_samples = zeros(length(initial_f), samples)
a_samples = zeros(length(initial_f), samples)
K_samples = Array{PDMats.PDMat}(undef, samples)
prev_logpml = -Inf
u_prior = MvNormal(length(initial_f), 1.0)
ΞΈ_map, f, Ξ£, a, B, K = map_laplace(data, choices, initial_ΞΈ, scale, prior;
verbose=true)
ΞΈ = ΞΈ_map
u = rand(prng, u_prior)
q = MvNormal(f, Ξ£)
logpml = pseudo_marginal_partial(prng, choices, q, K, scale, u)
u_acc_mavg = OnlineStats.Mean()
ΞΈ_acc_mavg = OnlineStats.Mean()
prog = ProgressMeter.Progress(samples+warmup)
for i = 1:(samples+warmup)
Lu = u_in->begin
pseudo_marginal_partial(prng, choices, q, K, scale, u_in)
end
u, logpml, u_nprop = ess_transition(prng, Lu, u, logpml, u_prior)
LΞΈ = ΞΈ_in->begin
logpml, f, q, K, Ξ£, a = pseudo_marginal_full(
prng, data, choices, scale,
ΞΈ_in[1], ΞΈ_in[2], ΞΈ_in[3:end], u)
logpml
end
ΞΈ, logpml, ΞΈ_nprop = ess_transition(prng, LΞΈ, ΞΈ, logpml, prior)
if(i > warmup)
ΞΈ_samples[:,i-warmup] = ΞΈ
f_samples[:,i-warmup] = f
a_samples[:,i-warmup] = a
K_samples[i-warmup] = K
end
u_acc = 1/u_nprop
ΞΈ_acc = 1/ΞΈ_nprop
OnlineStats.fit!(u_acc_mavg, u_acc)
OnlineStats.fit!(ΞΈ_acc_mavg, ΞΈ_acc)
ProgressMeter.next!(
prog; showvalues=[(:iteration, i),
(:pseudo_marginal_loglikelihood, logpml),
(:u_acceptance, u_acc),
(:ΞΈ_acceptance, ΞΈ_acc),
(:u_average_acceptance, u_acc_mavg.ΞΌ),
(:ΞΈ_average_acceptance, ΞΈ_acc_mavg.ΞΌ)
])
end
ΞΈ_samples = ΞΈ_samples[:,1:thinning:end]
f_samples = f_samples[:,1:thinning:end]
a_samples = a_samples[:,1:thinning:end]
K_samples = K_samples[1:thinning:end]
ΞΈ_samples, f_samples, a_samples, K_samples
end
|
(* Title: HOL/Analysis/Borel_Space.thy
Author: Johannes HΓΆlzl, TU MΓΌnchen
Author: Armin Heller, TU MΓΌnchen
*)
section \<open>Borel Space\<close>
theory Borel_Space
imports
Measurable Derivative Ordered_Euclidean_Space Extended_Real_Limits
begin
lemma is_interval_real_ereal_oo: "is_interval (real_of_ereal ` {N<..<M::ereal})"
by (auto simp: real_atLeastGreaterThan_eq)
lemma sets_Collect_eventually_sequentially[measurable]:
"(\<And>i. {x\<in>space M. P x i} \<in> sets M) \<Longrightarrow> {x\<in>space M. eventually (P x) sequentially} \<in> sets M"
unfolding eventually_sequentially by simp
lemma topological_basis_trivial: "topological_basis {A. open A}"
by (auto simp: topological_basis_def)
proposition open_prod_generated: "open = generate_topology {A \<times> B | A B. open A \<and> open B}"
proof -
have "{A \<times> B :: ('a \<times> 'b) set | A B. open A \<and> open B} = ((\<lambda>(a, b). a \<times> b) ` ({A. open A} \<times> {A. open A}))"
by auto
then show ?thesis
by (auto intro: topological_basis_prod topological_basis_trivial topological_basis_imp_subbasis)
qed
proposition mono_on_imp_deriv_nonneg:
assumes mono: "mono_on A f" and deriv: "(f has_real_derivative D) (at x)"
assumes "x \<in> interior A"
shows "D \<ge> 0"
proof (rule tendsto_lowerbound)
let ?A' = "(\<lambda>y. y - x) ` interior A"
from deriv show "((\<lambda>h. (f (x + h) - f x) / h) \<longlongrightarrow> D) (at 0)"
by (simp add: field_has_derivative_at has_field_derivative_def)
from mono have mono': "mono_on (interior A) f" by (rule mono_on_subset) (rule interior_subset)
show "eventually (\<lambda>h. (f (x + h) - f x) / h \<ge> 0) (at 0)"
proof (subst eventually_at_topological, intro exI conjI ballI impI)
have "open (interior A)" by simp
hence "open ((+) (-x) ` interior A)" by (rule open_translation)
also have "((+) (-x) ` interior A) = ?A'" by auto
finally show "open ?A'" .
next
from \<open>x \<in> interior A\<close> show "0 \<in> ?A'" by auto
next
fix h assume "h \<in> ?A'"
hence "x + h \<in> interior A" by auto
with mono' and \<open>x \<in> interior A\<close> show "(f (x + h) - f x) / h \<ge> 0"
by (cases h rule: linorder_cases[of _ 0])
(simp_all add: divide_nonpos_neg divide_nonneg_pos mono_onD field_simps)
qed
qed simp
proposition mono_on_ctble_discont:
fixes f :: "real \<Rightarrow> real"
fixes A :: "real set"
assumes "mono_on A f"
shows "countable {a\<in>A. \<not> continuous (at a within A) f}"
proof -
have mono: "\<And>x y. x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<le> y \<Longrightarrow> f x \<le> f y"
using \<open>mono_on A f\<close> by (simp add: mono_on_def)
have "\<forall>a \<in> {a\<in>A. \<not> continuous (at a within A) f}. \<exists>q :: nat \<times> rat.
(fst q = 0 \<and> of_rat (snd q) < f a \<and> (\<forall>x \<in> A. x < a \<longrightarrow> f x < of_rat (snd q))) \<or>
(fst q = 1 \<and> of_rat (snd q) > f a \<and> (\<forall>x \<in> A. x > a \<longrightarrow> f x > of_rat (snd q)))"
proof (clarsimp simp del: One_nat_def)
fix a assume "a \<in> A" assume "\<not> continuous (at a within A) f"
thus "\<exists>q1 q2.
q1 = 0 \<and> real_of_rat q2 < f a \<and> (\<forall>x\<in>A. x < a \<longrightarrow> f x < real_of_rat q2) \<or>
q1 = 1 \<and> f a < real_of_rat q2 \<and> (\<forall>x\<in>A. a < x \<longrightarrow> real_of_rat q2 < f x)"
proof (auto simp add: continuous_within order_tendsto_iff eventually_at)
fix l assume "l < f a"
then obtain q2 where q2: "l < of_rat q2" "of_rat q2 < f a"
using of_rat_dense by blast
assume * [rule_format]: "\<forall>d>0. \<exists>x\<in>A. x \<noteq> a \<and> dist x a < d \<and> \<not> l < f x"
from q2 have "real_of_rat q2 < f a \<and> (\<forall>x\<in>A. x < a \<longrightarrow> f x < real_of_rat q2)"
proof auto
fix x assume "x \<in> A" "x < a"
with q2 *[of "a - x"] show "f x < real_of_rat q2"
apply (auto simp add: dist_real_def not_less)
apply (subgoal_tac "f x \<le> f xa")
by (auto intro: mono)
qed
thus ?thesis by auto
next
fix u assume "u > f a"
then obtain q2 where q2: "f a < of_rat q2" "of_rat q2 < u"
using of_rat_dense by blast
assume *[rule_format]: "\<forall>d>0. \<exists>x\<in>A. x \<noteq> a \<and> dist x a < d \<and> \<not> u > f x"
from q2 have "real_of_rat q2 > f a \<and> (\<forall>x\<in>A. x > a \<longrightarrow> f x > real_of_rat q2)"
proof auto
fix x assume "x \<in> A" "x > a"
with q2 *[of "x - a"] show "f x > real_of_rat q2"
apply (auto simp add: dist_real_def)
apply (subgoal_tac "f x \<ge> f xa")
by (auto intro: mono)
qed
thus ?thesis by auto
qed
qed
then obtain g :: "real \<Rightarrow> nat \<times> rat" where "\<forall>a \<in> {a\<in>A. \<not> continuous (at a within A) f}.
(fst (g a) = 0 \<and> of_rat (snd (g a)) < f a \<and> (\<forall>x \<in> A. x < a \<longrightarrow> f x < of_rat (snd (g a)))) |
(fst (g a) = 1 \<and> of_rat (snd (g a)) > f a \<and> (\<forall>x \<in> A. x > a \<longrightarrow> f x > of_rat (snd (g a))))"
by (rule bchoice [THEN exE]) blast
hence g: "\<And>a x. a \<in> A \<Longrightarrow> \<not> continuous (at a within A) f \<Longrightarrow> x \<in> A \<Longrightarrow>
(fst (g a) = 0 \<and> of_rat (snd (g a)) < f a \<and> (x < a \<longrightarrow> f x < of_rat (snd (g a)))) |
(fst (g a) = 1 \<and> of_rat (snd (g a)) > f a \<and> (x > a \<longrightarrow> f x > of_rat (snd (g a))))"
by auto
have "inj_on g {a\<in>A. \<not> continuous (at a within A) f}"
proof (auto simp add: inj_on_def)
fix w z
assume 1: "w \<in> A" and 2: "\<not> continuous (at w within A) f" and
3: "z \<in> A" and 4: "\<not> continuous (at z within A) f" and
5: "g w = g z"
from g [OF 1 2 3] g [OF 3 4 1] 5
show "w = z" by auto
qed
thus ?thesis
by (rule countableI')
qed
lemma mono_on_ctble_discont_open:
fixes f :: "real \<Rightarrow> real"
fixes A :: "real set"
assumes "open A" "mono_on A f"
shows "countable {a\<in>A. \<not>isCont f a}"
proof -
have "{a\<in>A. \<not>isCont f a} = {a\<in>A. \<not>(continuous (at a within A) f)}"
by (auto simp add: continuous_within_open [OF _ \<open>open A\<close>])
thus ?thesis
apply (elim ssubst)
by (rule mono_on_ctble_discont, rule assms)
qed
lemma mono_ctble_discont:
fixes f :: "real \<Rightarrow> real"
assumes "mono f"
shows "countable {a. \<not> isCont f a}"
using assms mono_on_ctble_discont [of UNIV f] unfolding mono_on_def mono_def by auto
lemma has_real_derivative_imp_continuous_on:
assumes "\<And>x. x \<in> A \<Longrightarrow> (f has_real_derivative f' x) (at x)"
shows "continuous_on A f"
apply (intro differentiable_imp_continuous_on, unfold differentiable_on_def)
using assms differentiable_at_withinI real_differentiable_def by blast
lemma continuous_interval_vimage_Int:
assumes "continuous_on {a::real..b} g" and mono: "\<And>x y. a \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> b \<Longrightarrow> g x \<le> g y"
assumes "a \<le> b" "(c::real) \<le> d" "{c..d} \<subseteq> {g a..g b}"
obtains c' d' where "{a..b} \<inter> g -` {c..d} = {c'..d'}" "c' \<le> d'" "g c' = c" "g d' = d"
proof-
let ?A = "{a..b} \<inter> g -` {c..d}"
from IVT'[of g a c b, OF _ _ \<open>a \<le> b\<close> assms(1)] assms(4,5)
obtain c'' where c'': "c'' \<in> ?A" "g c'' = c" by auto
from IVT'[of g a d b, OF _ _ \<open>a \<le> b\<close> assms(1)] assms(4,5)
obtain d'' where d'': "d'' \<in> ?A" "g d'' = d" by auto
hence [simp]: "?A \<noteq> {}" by blast
define c' where "c' = Inf ?A"
define d' where "d' = Sup ?A"
have "?A \<subseteq> {c'..d'}" unfolding c'_def d'_def
by (intro subsetI) (auto intro: cInf_lower cSup_upper)
moreover from assms have "closed ?A"
using continuous_on_closed_vimage[of "{a..b}" g] by (subst Int_commute) simp
hence c'd'_in_set: "c' \<in> ?A" "d' \<in> ?A" unfolding c'_def d'_def
by ((intro closed_contains_Inf closed_contains_Sup, simp_all)[])+
hence "{c'..d'} \<subseteq> ?A" using assms
by (intro subsetI)
(auto intro!: order_trans[of c "g c'" "g x" for x] order_trans[of "g x" "g d'" d for x]
intro!: mono)
moreover have "c' \<le> d'" using c'd'_in_set(2) unfolding c'_def by (intro cInf_lower) auto
moreover have "g c' \<le> c" "g d' \<ge> d"
apply (insert c'' d'' c'd'_in_set)
apply (subst c''(2)[symmetric])
apply (auto simp: c'_def intro!: mono cInf_lower c'') []
apply (subst d''(2)[symmetric])
apply (auto simp: d'_def intro!: mono cSup_upper d'') []
done
with c'd'_in_set have "g c' = c" "g d' = d" by auto
ultimately show ?thesis using that by blast
qed
subsection \<open>Generic Borel spaces\<close>
definition\<^marker>\<open>tag important\<close> (in topological_space) borel :: "'a measure" where
"borel = sigma UNIV {S. open S}"
abbreviation "borel_measurable M \<equiv> measurable M borel"
lemma in_borel_measurable:
"f \<in> borel_measurable M \<longleftrightarrow>
(\<forall>S \<in> sigma_sets UNIV {S. open S}. f -` S \<inter> space M \<in> sets M)"
by (auto simp add: measurable_def borel_def)
lemma in_borel_measurable_borel:
"f \<in> borel_measurable M \<longleftrightarrow>
(\<forall>S \<in> sets borel.
f -` S \<inter> space M \<in> sets M)"
by (auto simp add: measurable_def borel_def)
lemma space_borel[simp]: "space borel = UNIV"
unfolding borel_def by auto
lemma space_in_borel[measurable]: "UNIV \<in> sets borel"
unfolding borel_def by auto
lemma sets_borel: "sets borel = sigma_sets UNIV {S. open S}"
unfolding borel_def by (rule sets_measure_of) simp
lemma measurable_sets_borel:
"\<lbrakk>f \<in> measurable borel M; A \<in> sets M\<rbrakk> \<Longrightarrow> f -` A \<in> sets borel"
by (drule (1) measurable_sets) simp
lemma pred_Collect_borel[measurable (raw)]: "Measurable.pred borel P \<Longrightarrow> {x. P x} \<in> sets borel"
unfolding borel_def pred_def by auto
lemma borel_open[measurable (raw generic)]:
assumes "open A" shows "A \<in> sets borel"
proof -
have "A \<in> {S. open S}" unfolding mem_Collect_eq using assms .
thus ?thesis unfolding borel_def by auto
qed
lemma borel_closed[measurable (raw generic)]:
assumes "closed A" shows "A \<in> sets borel"
proof -
have "space borel - (- A) \<in> sets borel"
using assms unfolding closed_def by (blast intro: borel_open)
thus ?thesis by simp
qed
lemma borel_singleton[measurable]:
"A \<in> sets borel \<Longrightarrow> insert x A \<in> sets (borel :: 'a::t1_space measure)"
unfolding insert_def by (rule sets.Un) auto
lemma sets_borel_eq_count_space: "sets (borel :: 'a::{countable, t2_space} measure) = count_space UNIV"
proof -
have "(\<Union>a\<in>A. {a}) \<in> sets borel" for A :: "'a set"
by (intro sets.countable_UN') auto
then show ?thesis
by auto
qed
lemma borel_comp[measurable]: "A \<in> sets borel \<Longrightarrow> - A \<in> sets borel"
unfolding Compl_eq_Diff_UNIV by simp
lemma borel_measurable_vimage:
fixes f :: "'a \<Rightarrow> 'x::t2_space"
assumes borel[measurable]: "f \<in> borel_measurable M"
shows "f -` {x} \<inter> space M \<in> sets M"
by simp
lemma borel_measurableI:
fixes f :: "'a \<Rightarrow> 'x::topological_space"
assumes "\<And>S. open S \<Longrightarrow> f -` S \<inter> space M \<in> sets M"
shows "f \<in> borel_measurable M"
unfolding borel_def
proof (rule measurable_measure_of, simp_all)
fix S :: "'x set" assume "open S" thus "f -` S \<inter> space M \<in> sets M"
using assms[of S] by simp
qed
lemma borel_measurable_const:
"(\<lambda>x. c) \<in> borel_measurable M"
by auto
lemma borel_measurable_indicator:
assumes A: "A \<in> sets M"
shows "indicator A \<in> borel_measurable M"
unfolding indicator_def [abs_def] using A
by (auto intro!: measurable_If_set)
lemma borel_measurable_count_space[measurable (raw)]:
"f \<in> borel_measurable (count_space S)"
unfolding measurable_def by auto
lemma borel_measurable_indicator'[measurable (raw)]:
assumes [measurable]: "{x\<in>space M. f x \<in> A x} \<in> sets M"
shows "(\<lambda>x. indicator (A x) (f x)) \<in> borel_measurable M"
unfolding indicator_def[abs_def]
by (auto intro!: measurable_If)
lemma borel_measurable_indicator_iff:
"(indicator A :: 'a \<Rightarrow> 'x::{t1_space, zero_neq_one}) \<in> borel_measurable M \<longleftrightarrow> A \<inter> space M \<in> sets M"
(is "?I \<in> borel_measurable M \<longleftrightarrow> _")
proof
assume "?I \<in> borel_measurable M"
then have "?I -` {1} \<inter> space M \<in> sets M"
unfolding measurable_def by auto
also have "?I -` {1} \<inter> space M = A \<inter> space M"
unfolding indicator_def [abs_def] by auto
finally show "A \<inter> space M \<in> sets M" .
next
assume "A \<inter> space M \<in> sets M"
moreover have "?I \<in> borel_measurable M \<longleftrightarrow>
(indicator (A \<inter> space M) :: 'a \<Rightarrow> 'x) \<in> borel_measurable M"
by (intro measurable_cong) (auto simp: indicator_def)
ultimately show "?I \<in> borel_measurable M" by auto
qed
lemma borel_measurable_subalgebra:
assumes "sets N \<subseteq> sets M" "space N = space M" "f \<in> borel_measurable N"
shows "f \<in> borel_measurable M"
using assms unfolding measurable_def by auto
lemma borel_measurable_restrict_space_iff_ereal:
fixes f :: "'a \<Rightarrow> ereal"
assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M"
shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow>
(\<lambda>x. f x * indicator \<Omega> x) \<in> borel_measurable M"
by (subst measurable_restrict_space_iff)
(auto simp: indicator_def of_bool_def if_distrib[where f="\<lambda>x. a * x" for a] cong del: if_weak_cong)
lemma borel_measurable_restrict_space_iff_ennreal:
fixes f :: "'a \<Rightarrow> ennreal"
assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M"
shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow>
(\<lambda>x. f x * indicator \<Omega> x) \<in> borel_measurable M"
by (subst measurable_restrict_space_iff)
(auto simp: indicator_def of_bool_def if_distrib[where f="\<lambda>x. a * x" for a] cong del: if_weak_cong)
lemma borel_measurable_restrict_space_iff:
fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M"
shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow>
(\<lambda>x. indicator \<Omega> x *\<^sub>R f x) \<in> borel_measurable M"
by (subst measurable_restrict_space_iff)
(auto simp: indicator_def of_bool_def if_distrib[where f="\<lambda>x. x *\<^sub>R a" for a] ac_simps
cong del: if_weak_cong)
lemma cbox_borel[measurable]: "cbox a b \<in> sets borel"
by (auto intro: borel_closed)
lemma box_borel[measurable]: "box a b \<in> sets borel"
by (auto intro: borel_open)
lemma borel_compact: "compact (A::'a::t2_space set) \<Longrightarrow> A \<in> sets borel"
by (auto intro: borel_closed dest!: compact_imp_closed)
lemma borel_sigma_sets_subset:
"A \<subseteq> sets borel \<Longrightarrow> sigma_sets UNIV A \<subseteq> sets borel"
using sets.sigma_sets_subset[of A borel] by simp
lemma borel_eq_sigmaI1:
fixes F :: "'i \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set"
assumes borel_eq: "borel = sigma UNIV X"
assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV (F ` A))"
assumes F: "\<And>i. i \<in> A \<Longrightarrow> F i \<in> sets borel"
shows "borel = sigma UNIV (F ` A)"
unfolding borel_def
proof (intro sigma_eqI antisym)
have borel_rev_eq: "sigma_sets UNIV {S::'a set. open S} = sets borel"
unfolding borel_def by simp
also have "\<dots> = sigma_sets UNIV X"
unfolding borel_eq by simp
also have "\<dots> \<subseteq> sigma_sets UNIV (F`A)"
using X by (intro sigma_algebra.sigma_sets_subset[OF sigma_algebra_sigma_sets]) auto
finally show "sigma_sets UNIV {S. open S} \<subseteq> sigma_sets UNIV (F`A)" .
show "sigma_sets UNIV (F`A) \<subseteq> sigma_sets UNIV {S. open S}"
unfolding borel_rev_eq using F by (intro borel_sigma_sets_subset) auto
qed auto
lemma borel_eq_sigmaI2:
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set"
and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set"
assumes borel_eq: "borel = sigma UNIV ((\<lambda>(i, j). G i j)`B)"
assumes X: "\<And>i j. (i, j) \<in> B \<Longrightarrow> G i j \<in> sets (sigma UNIV ((\<lambda>(i, j). F i j) ` A))"
assumes F: "\<And>i j. (i, j) \<in> A \<Longrightarrow> F i j \<in> sets borel"
shows "borel = sigma UNIV ((\<lambda>(i, j). F i j) ` A)"
using assms
by (intro borel_eq_sigmaI1[where X="(\<lambda>(i, j). G i j) ` B" and F="(\<lambda>(i, j). F i j)"]) auto
lemma borel_eq_sigmaI3:
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and X :: "'a::topological_space set set"
assumes borel_eq: "borel = sigma UNIV X"
assumes X: "\<And>x. x \<in> X \<Longrightarrow> x \<in> sets (sigma UNIV ((\<lambda>(i, j). F i j) ` A))"
assumes F: "\<And>i j. (i, j) \<in> A \<Longrightarrow> F i j \<in> sets borel"
shows "borel = sigma UNIV ((\<lambda>(i, j). F i j) ` A)"
using assms by (intro borel_eq_sigmaI1[where X=X and F="(\<lambda>(i, j). F i j)"]) auto
lemma borel_eq_sigmaI4:
fixes F :: "'i \<Rightarrow> 'a::topological_space set"
and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set"
assumes borel_eq: "borel = sigma UNIV ((\<lambda>(i, j). G i j)`A)"
assumes X: "\<And>i j. (i, j) \<in> A \<Longrightarrow> G i j \<in> sets (sigma UNIV (range F))"
assumes F: "\<And>i. F i \<in> sets borel"
shows "borel = sigma UNIV (range F)"
using assms by (intro borel_eq_sigmaI1[where X="(\<lambda>(i, j). G i j) ` A" and F=F]) auto
lemma borel_eq_sigmaI5:
fixes F :: "'i \<Rightarrow> 'j \<Rightarrow> 'a::topological_space set" and G :: "'l \<Rightarrow> 'a::topological_space set"
assumes borel_eq: "borel = sigma UNIV (range G)"
assumes X: "\<And>i. G i \<in> sets (sigma UNIV (range (\<lambda>(i, j). F i j)))"
assumes F: "\<And>i j. F i j \<in> sets borel"
shows "borel = sigma UNIV (range (\<lambda>(i, j). F i j))"
using assms by (intro borel_eq_sigmaI1[where X="range G" and F="(\<lambda>(i, j). F i j)"]) auto
theorem second_countable_borel_measurable:
fixes X :: "'a::second_countable_topology set set"
assumes eq: "open = generate_topology X"
shows "borel = sigma UNIV X"
unfolding borel_def
proof (intro sigma_eqI sigma_sets_eqI)
interpret X: sigma_algebra UNIV "sigma_sets UNIV X"
by (rule sigma_algebra_sigma_sets) simp
fix S :: "'a set" assume "S \<in> Collect open"
then have "generate_topology X S"
by (auto simp: eq)
then show "S \<in> sigma_sets UNIV X"
proof induction
case (UN K)
then have K: "\<And>k. k \<in> K \<Longrightarrow> open k"
unfolding eq by auto
from ex_countable_basis obtain B :: "'a set set" where
B: "\<And>b. b \<in> B \<Longrightarrow> open b" "\<And>X. open X \<Longrightarrow> \<exists>b\<subseteq>B. (\<Union>b) = X" and "countable B"
by (auto simp: topological_basis_def)
from B(2)[OF K] obtain m where m: "\<And>k. k \<in> K \<Longrightarrow> m k \<subseteq> B" "\<And>k. k \<in> K \<Longrightarrow> \<Union>(m k) = k"
by metis
define U where "U = (\<Union>k\<in>K. m k)"
with m have "countable U"
by (intro countable_subset[OF _ \<open>countable B\<close>]) auto
have "\<Union>U = (\<Union>A\<in>U. A)" by simp
also have "\<dots> = \<Union>K"
unfolding U_def UN_simps by (simp add: m)
finally have "\<Union>U = \<Union>K" .
have "\<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k"
using m by (auto simp: U_def)
then obtain u where u: "\<And>b. b \<in> U \<Longrightarrow> u b \<in> K" and "\<And>b. b \<in> U \<Longrightarrow> b \<subseteq> u b"
by metis
then have "(\<Union>b\<in>U. u b) \<subseteq> \<Union>K" "\<Union>U \<subseteq> (\<Union>b\<in>U. u b)"
by auto
then have "\<Union>K = (\<Union>b\<in>U. u b)"
unfolding \<open>\<Union>U = \<Union>K\<close> by auto
also have "\<dots> \<in> sigma_sets UNIV X"
using u UN by (intro X.countable_UN' \<open>countable U\<close>) auto
finally show "\<Union>K \<in> sigma_sets UNIV X" .
qed auto
qed (auto simp: eq intro: generate_topology.Basis)
lemma borel_eq_closed: "borel = sigma UNIV (Collect closed)"
unfolding borel_def
proof (intro sigma_eqI sigma_sets_eqI, safe)
fix x :: "'a set" assume "open x"
hence "x = UNIV - (UNIV - x)" by auto
also have "\<dots> \<in> sigma_sets UNIV (Collect closed)"
by (force intro: sigma_sets.Compl simp: \<open>open x\<close>)
finally show "x \<in> sigma_sets UNIV (Collect closed)" by simp
next
fix x :: "'a set" assume "closed x"
hence "x = UNIV - (UNIV - x)" by auto
also have "\<dots> \<in> sigma_sets UNIV (Collect open)"
by (force intro: sigma_sets.Compl simp: \<open>closed x\<close>)
finally show "x \<in> sigma_sets UNIV (Collect open)" by simp
qed simp_all
proposition borel_eq_countable_basis:
fixes B::"'a::topological_space set set"
assumes "countable B"
assumes "topological_basis B"
shows "borel = sigma UNIV B"
unfolding borel_def
proof (intro sigma_eqI sigma_sets_eqI, safe)
interpret countable_basis "open" B using assms by (rule countable_basis_openI)
fix X::"'a set" assume "open X"
from open_countable_basisE[OF this] obtain B' where B': "B' \<subseteq> B" "X = \<Union> B'" .
then show "X \<in> sigma_sets UNIV B"
by (blast intro: sigma_sets_UNION \<open>countable B\<close> countable_subset)
next
fix b assume "b \<in> B"
hence "open b" by (rule topological_basis_open[OF assms(2)])
thus "b \<in> sigma_sets UNIV (Collect open)" by auto
qed simp_all
lemma borel_measurable_continuous_on_restrict:
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
assumes f: "continuous_on A f"
shows "f \<in> borel_measurable (restrict_space borel A)"
proof (rule borel_measurableI)
fix S :: "'b set" assume "open S"
with f obtain T where "f -` S \<inter> A = T \<inter> A" "open T"
by (metis continuous_on_open_invariant)
then show "f -` S \<inter> space (restrict_space borel A) \<in> sets (restrict_space borel A)"
by (force simp add: sets_restrict_space space_restrict_space)
qed
lemma borel_measurable_continuous_onI: "continuous_on UNIV f \<Longrightarrow> f \<in> borel_measurable borel"
by (drule borel_measurable_continuous_on_restrict) simp
lemma borel_measurable_continuous_on_if:
"A \<in> sets borel \<Longrightarrow> continuous_on A f \<Longrightarrow> continuous_on (- A) g \<Longrightarrow>
(\<lambda>x. if x \<in> A then f x else g x) \<in> borel_measurable borel"
by (auto simp add: measurable_If_restrict_space_iff Collect_neg_eq
intro!: borel_measurable_continuous_on_restrict)
lemma borel_measurable_continuous_countable_exceptions:
fixes f :: "'a::t1_space \<Rightarrow> 'b::topological_space"
assumes X: "countable X"
assumes "continuous_on (- X) f"
shows "f \<in> borel_measurable borel"
proof (rule measurable_discrete_difference[OF _ X])
have "X \<in> sets borel"
by (rule sets.countable[OF _ X]) auto
then show "(\<lambda>x. if x \<in> X then undefined else f x) \<in> borel_measurable borel"
by (intro borel_measurable_continuous_on_if assms continuous_intros)
qed auto
lemma borel_measurable_continuous_on:
assumes f: "continuous_on UNIV f" and g: "g \<in> borel_measurable M"
shows "(\<lambda>x. f (g x)) \<in> borel_measurable M"
using measurable_comp[OF g borel_measurable_continuous_onI[OF f]] by (simp add: comp_def)
lemma borel_measurable_continuous_on_indicator:
fixes f g :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector"
shows "A \<in> sets borel \<Longrightarrow> continuous_on A f \<Longrightarrow> (\<lambda>x. indicator A x *\<^sub>R f x) \<in> borel_measurable borel"
by (subst borel_measurable_restrict_space_iff[symmetric])
(auto intro: borel_measurable_continuous_on_restrict)
lemma borel_measurable_Pair[measurable (raw)]:
fixes f :: "'a \<Rightarrow> 'b::second_countable_topology" and g :: "'a \<Rightarrow> 'c::second_countable_topology"
assumes f[measurable]: "f \<in> borel_measurable M"
assumes g[measurable]: "g \<in> borel_measurable M"
shows "(\<lambda>x. (f x, g x)) \<in> borel_measurable M"
proof (subst borel_eq_countable_basis)
let ?B = "SOME B::'b set set. countable B \<and> topological_basis B"
let ?C = "SOME B::'c set set. countable B \<and> topological_basis B"
let ?P = "(\<lambda>(b, c). b \<times> c) ` (?B \<times> ?C)"
show "countable ?P" "topological_basis ?P"
by (auto intro!: countable_basis topological_basis_prod is_basis)
show "(\<lambda>x. (f x, g x)) \<in> measurable M (sigma UNIV ?P)"
proof (rule measurable_measure_of)
fix S assume "S \<in> ?P"
then obtain b c where "b \<in> ?B" "c \<in> ?C" and S: "S = b \<times> c" by auto
then have borel: "open b" "open c"
by (auto intro: is_basis topological_basis_open)
have "(\<lambda>x. (f x, g x)) -` S \<inter> space M = (f -` b \<inter> space M) \<inter> (g -` c \<inter> space M)"
unfolding S by auto
also have "\<dots> \<in> sets M"
using borel by simp
finally show "(\<lambda>x. (f x, g x)) -` S \<inter> space M \<in> sets M" .
qed auto
qed
lemma borel_measurable_continuous_Pair:
fixes f :: "'a \<Rightarrow> 'b::second_countable_topology" and g :: "'a \<Rightarrow> 'c::second_countable_topology"
assumes [measurable]: "f \<in> borel_measurable M"
assumes [measurable]: "g \<in> borel_measurable M"
assumes H: "continuous_on UNIV (\<lambda>x. H (fst x) (snd x))"
shows "(\<lambda>x. H (f x) (g x)) \<in> borel_measurable M"
proof -
have eq: "(\<lambda>x. H (f x) (g x)) = (\<lambda>x. (\<lambda>x. H (fst x) (snd x)) (f x, g x))" by auto
show ?thesis
unfolding eq by (rule borel_measurable_continuous_on[OF H]) auto
qed
subsection \<open>Borel spaces on order topologies\<close>
lemma [measurable]:
fixes a b :: "'a::linorder_topology"
shows lessThan_borel: "{..< a} \<in> sets borel"
and greaterThan_borel: "{a <..} \<in> sets borel"
and greaterThanLessThan_borel: "{a<..<b} \<in> sets borel"
and atMost_borel: "{..a} \<in> sets borel"
and atLeast_borel: "{a..} \<in> sets borel"
and atLeastAtMost_borel: "{a..b} \<in> sets borel"
and greaterThanAtMost_borel: "{a<..b} \<in> sets borel"
and atLeastLessThan_borel: "{a..<b} \<in> sets borel"
unfolding greaterThanAtMost_def atLeastLessThan_def
by (blast intro: borel_open borel_closed open_lessThan open_greaterThan open_greaterThanLessThan
closed_atMost closed_atLeast closed_atLeastAtMost)+
lemma borel_Iio:
"borel = sigma UNIV (range lessThan :: 'a::{linorder_topology, second_countable_topology} set set)"
unfolding second_countable_borel_measurable[OF open_generated_order]
proof (intro sigma_eqI sigma_sets_eqI)
obtain D :: "'a set" where D: "countable D" "\<And>X. open X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<exists>d\<in>D. d \<in> X"
by (rule countable_dense_setE) blast
interpret L: sigma_algebra UNIV "sigma_sets UNIV (range lessThan)"
by (rule sigma_algebra_sigma_sets) simp
fix A :: "'a set" assume "A \<in> range lessThan \<union> range greaterThan"
then obtain y where "A = {y <..} \<or> A = {..< y}"
by blast
then show "A \<in> sigma_sets UNIV (range lessThan)"
proof
assume A: "A = {y <..}"
show ?thesis
proof cases
assume "\<forall>x>y. \<exists>d. y < d \<and> d < x"
with D(2)[of "{y <..< x}" for x] have "\<forall>x>y. \<exists>d\<in>D. y < d \<and> d < x"
by (auto simp: set_eq_iff)
then have "A = UNIV - (\<Inter>d\<in>{d\<in>D. y < d}. {..< d})"
by (auto simp: A) (metis less_asym)
also have "\<dots> \<in> sigma_sets UNIV (range lessThan)"
using D(1) by (intro L.Diff L.top L.countable_INT'') auto
finally show ?thesis .
next
assume "\<not> (\<forall>x>y. \<exists>d. y < d \<and> d < x)"
then obtain x where "y < x" "\<And>d. y < d \<Longrightarrow> \<not> d < x"
by auto
then have "A = UNIV - {..< x}"
unfolding A by (auto simp: not_less[symmetric])
also have "\<dots> \<in> sigma_sets UNIV (range lessThan)"
by auto
finally show ?thesis .
qed
qed auto
qed auto
lemma borel_Ioi:
"borel = sigma UNIV (range greaterThan :: 'a::{linorder_topology, second_countable_topology} set set)"
unfolding second_countable_borel_measurable[OF open_generated_order]
proof (intro sigma_eqI sigma_sets_eqI)
obtain D :: "'a set" where D: "countable D" "\<And>X. open X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<exists>d\<in>D. d \<in> X"
by (rule countable_dense_setE) blast
interpret L: sigma_algebra UNIV "sigma_sets UNIV (range greaterThan)"
by (rule sigma_algebra_sigma_sets) simp
fix A :: "'a set" assume "A \<in> range lessThan \<union> range greaterThan"
then obtain y where "A = {y <..} \<or> A = {..< y}"
by blast
then show "A \<in> sigma_sets UNIV (range greaterThan)"
proof
assume A: "A = {..< y}"
show ?thesis
proof cases
assume "\<forall>x<y. \<exists>d. x < d \<and> d < y"
with D(2)[of "{x <..< y}" for x] have "\<forall>x<y. \<exists>d\<in>D. x < d \<and> d < y"
by (auto simp: set_eq_iff)
then have "A = UNIV - (\<Inter>d\<in>{d\<in>D. d < y}. {d <..})"
by (auto simp: A) (metis less_asym)
also have "\<dots> \<in> sigma_sets UNIV (range greaterThan)"
using D(1) by (intro L.Diff L.top L.countable_INT'') auto
finally show ?thesis .
next
assume "\<not> (\<forall>x<y. \<exists>d. x < d \<and> d < y)"
then obtain x where "x < y" "\<And>d. y > d \<Longrightarrow> x \<ge> d"
by (auto simp: not_less[symmetric])
then have "A = UNIV - {x <..}"
unfolding A Compl_eq_Diff_UNIV[symmetric] by auto
also have "\<dots> \<in> sigma_sets UNIV (range greaterThan)"
by auto
finally show ?thesis .
qed
qed auto
qed auto
lemma borel_measurableI_less:
fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
shows "(\<And>y. {x\<in>space M. f x < y} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
unfolding borel_Iio
by (rule measurable_measure_of) (auto simp: Int_def conj_commute)
lemma borel_measurableI_greater:
fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
shows "(\<And>y. {x\<in>space M. y < f x} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
unfolding borel_Ioi
by (rule measurable_measure_of) (auto simp: Int_def conj_commute)
lemma borel_measurableI_le:
fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
shows "(\<And>y. {x\<in>space M. f x \<le> y} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
by (rule borel_measurableI_greater) (auto simp: not_le[symmetric])
lemma borel_measurableI_ge:
fixes f :: "'a \<Rightarrow> 'b::{linorder_topology, second_countable_topology}"
shows "(\<And>y. {x\<in>space M. y \<le> f x} \<in> sets M) \<Longrightarrow> f \<in> borel_measurable M"
by (rule borel_measurableI_less) (auto simp: not_le[symmetric])
lemma borel_measurable_less[measurable]:
fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, linorder_topology}"
assumes "f \<in> borel_measurable M"
assumes "g \<in> borel_measurable M"
shows "{w \<in> space M. f w < g w} \<in> sets M"
proof -
have "{w \<in> space M. f w < g w} = (\<lambda>x. (f x, g x)) -` {x. fst x < snd x} \<inter> space M"
by auto
also have "\<dots> \<in> sets M"
by (intro measurable_sets[OF borel_measurable_Pair borel_open, OF assms open_Collect_less]
continuous_intros)
finally show ?thesis .
qed
lemma
fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, linorder_topology}"
assumes f[measurable]: "f \<in> borel_measurable M"
assumes g[measurable]: "g \<in> borel_measurable M"
shows borel_measurable_le[measurable]: "{w \<in> space M. f w \<le> g w} \<in> sets M"
and borel_measurable_eq[measurable]: "{w \<in> space M. f w = g w} \<in> sets M"
and borel_measurable_neq: "{w \<in> space M. f w \<noteq> g w} \<in> sets M"
unfolding eq_iff not_less[symmetric]
by measurable
lemma borel_measurable_SUP[measurable (raw)]:
fixes F :: "_ \<Rightarrow> _ \<Rightarrow> _::{complete_linorder, linorder_topology, second_countable_topology}"
assumes [simp]: "countable I"
assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M"
shows "(\<lambda>x. SUP i\<in>I. F i x) \<in> borel_measurable M"
by (rule borel_measurableI_greater) (simp add: less_SUP_iff)
lemma borel_measurable_INF[measurable (raw)]:
fixes F :: "_ \<Rightarrow> _ \<Rightarrow> _::{complete_linorder, linorder_topology, second_countable_topology}"
assumes [simp]: "countable I"
assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M"
shows "(\<lambda>x. INF i\<in>I. F i x) \<in> borel_measurable M"
by (rule borel_measurableI_less) (simp add: INF_less_iff)
lemma borel_measurable_cSUP[measurable (raw)]:
fixes F :: "_ \<Rightarrow> _ \<Rightarrow> 'a::{conditionally_complete_linorder, linorder_topology, second_countable_topology}"
assumes [simp]: "countable I"
assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M"
assumes bdd: "\<And>x. x \<in> space M \<Longrightarrow> bdd_above ((\<lambda>i. F i x) ` I)"
shows "(\<lambda>x. SUP i\<in>I. F i x) \<in> borel_measurable M"
proof cases
assume "I = {}" then show ?thesis
unfolding \<open>I = {}\<close> image_empty by simp
next
assume "I \<noteq> {}"
show ?thesis
proof (rule borel_measurableI_le)
fix y
have "{x \<in> space M. \<forall>i\<in>I. F i x \<le> y} \<in> sets M"
by measurable
also have "{x \<in> space M. \<forall>i\<in>I. F i x \<le> y} = {x \<in> space M. (SUP i\<in>I. F i x) \<le> y}"
by (simp add: cSUP_le_iff \<open>I \<noteq> {}\<close> bdd cong: conj_cong)
finally show "{x \<in> space M. (SUP i\<in>I. F i x) \<le> y} \<in> sets M" .
qed
qed
lemma borel_measurable_cINF[measurable (raw)]:
fixes F :: "_ \<Rightarrow> _ \<Rightarrow> 'a::{conditionally_complete_linorder, linorder_topology, second_countable_topology}"
assumes [simp]: "countable I"
assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M"
assumes bdd: "\<And>x. x \<in> space M \<Longrightarrow> bdd_below ((\<lambda>i. F i x) ` I)"
shows "(\<lambda>x. INF i\<in>I. F i x) \<in> borel_measurable M"
proof cases
assume "I = {}" then show ?thesis
unfolding \<open>I = {}\<close> image_empty by simp
next
assume "I \<noteq> {}"
show ?thesis
proof (rule borel_measurableI_ge)
fix y
have "{x \<in> space M. \<forall>i\<in>I. y \<le> F i x} \<in> sets M"
by measurable
also have "{x \<in> space M. \<forall>i\<in>I. y \<le> F i x} = {x \<in> space M. y \<le> (INF i\<in>I. F i x)}"
by (simp add: le_cINF_iff \<open>I \<noteq> {}\<close> bdd cong: conj_cong)
finally show "{x \<in> space M. y \<le> (INF i\<in>I. F i x)} \<in> sets M" .
qed
qed
lemma borel_measurable_lfp[consumes 1, case_names continuity step]:
fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_linorder, linorder_topology, second_countable_topology})"
assumes "sup_continuous F"
assumes *: "\<And>f. f \<in> borel_measurable M \<Longrightarrow> F f \<in> borel_measurable M"
shows "lfp F \<in> borel_measurable M"
proof -
{ fix i have "((F ^^ i) bot) \<in> borel_measurable M"
by (induct i) (auto intro!: *) }
then have "(\<lambda>x. SUP i. (F ^^ i) bot x) \<in> borel_measurable M"
by measurable
also have "(\<lambda>x. SUP i. (F ^^ i) bot x) = (SUP i. (F ^^ i) bot)"
by (auto simp add: image_comp)
also have "(SUP i. (F ^^ i) bot) = lfp F"
by (rule sup_continuous_lfp[symmetric]) fact
finally show ?thesis .
qed
lemma borel_measurable_gfp[consumes 1, case_names continuity step]:
fixes F :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b::{complete_linorder, linorder_topology, second_countable_topology})"
assumes "inf_continuous F"
assumes *: "\<And>f. f \<in> borel_measurable M \<Longrightarrow> F f \<in> borel_measurable M"
shows "gfp F \<in> borel_measurable M"
proof -
{ fix i have "((F ^^ i) top) \<in> borel_measurable M"
by (induct i) (auto intro!: * simp: bot_fun_def) }
then have "(\<lambda>x. INF i. (F ^^ i) top x) \<in> borel_measurable M"
by measurable
also have "(\<lambda>x. INF i. (F ^^ i) top x) = (INF i. (F ^^ i) top)"
by (auto simp add: image_comp)
also have "\<dots> = gfp F"
by (rule inf_continuous_gfp[symmetric]) fact
finally show ?thesis .
qed
lemma borel_measurable_max[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. max (g x) (f x) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
by (rule borel_measurableI_less) simp
lemma borel_measurable_min[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. min (g x) (f x) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
by (rule borel_measurableI_greater) simp
lemma borel_measurable_Min[measurable (raw)]:
"finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. Min ((\<lambda>i. f i x)`I) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
proof (induct I rule: finite_induct)
case (insert i I) then show ?case
by (cases "I = {}") auto
qed auto
lemma borel_measurable_Max[measurable (raw)]:
"finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. Max ((\<lambda>i. f i x)`I) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
proof (induct I rule: finite_induct)
case (insert i I) then show ?case
by (cases "I = {}") auto
qed auto
lemma borel_measurable_sup[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. sup (g x) (f x) :: 'b::{lattice, second_countable_topology, linorder_topology}) \<in> borel_measurable M"
unfolding sup_max by measurable
lemma borel_measurable_inf[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. inf (g x) (f x) :: 'b::{lattice, second_countable_topology, linorder_topology}) \<in> borel_measurable M"
unfolding inf_min by measurable
lemma [measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
assumes "\<And>i. f i \<in> borel_measurable M"
shows borel_measurable_liminf: "(\<lambda>x. liminf (\<lambda>i. f i x)) \<in> borel_measurable M"
and borel_measurable_limsup: "(\<lambda>x. limsup (\<lambda>i. f i x)) \<in> borel_measurable M"
unfolding liminf_SUP_INF limsup_INF_SUP using assms by auto
lemma measurable_convergent[measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
assumes [measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "Measurable.pred M (\<lambda>x. convergent (\<lambda>i. f i x))"
unfolding convergent_ereal by measurable
lemma sets_Collect_convergent[measurable]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "{x\<in>space M. convergent (\<lambda>i. f i x)} \<in> sets M"
by measurable
lemma borel_measurable_lim[measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
assumes [measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "(\<lambda>x. lim (\<lambda>i. f i x)) \<in> borel_measurable M"
proof -
have "\<And>x. lim (\<lambda>i. f i x) = (if convergent (\<lambda>i. f i x) then limsup (\<lambda>i. f i x) else (THE i. False))"
by (simp add: lim_def convergent_def convergent_limsup_cl)
then show ?thesis
by simp
qed
lemma borel_measurable_LIMSEQ_order:
fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) \<longlonglongrightarrow> u' x"
and u: "\<And>i. u i \<in> borel_measurable M"
shows "u' \<in> borel_measurable M"
proof -
have "\<And>x. x \<in> space M \<Longrightarrow> u' x = liminf (\<lambda>n. u n x)"
using u' by (simp add: lim_imp_Liminf[symmetric])
with u show ?thesis by (simp cong: measurable_cong)
qed
subsection \<open>Borel spaces on topological monoids\<close>
lemma borel_measurable_add[measurable (raw)]:
fixes f g :: "'a \<Rightarrow> 'b::{second_countable_topology, topological_monoid_add}"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
shows "(\<lambda>x. f x + g x) \<in> borel_measurable M"
using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros)
lemma borel_measurable_sum[measurable (raw)]:
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> 'b::{second_countable_topology, topological_comm_monoid_add}"
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M"
proof cases
assume "finite S"
thus ?thesis using assms by induct auto
qed simp
lemma borel_measurable_suminf_order[measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology, topological_comm_monoid_add}"
assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "(\<lambda>x. suminf (\<lambda>i. f i x)) \<in> borel_measurable M"
unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp
subsection \<open>Borel spaces on Euclidean spaces\<close>
lemma borel_measurable_inner[measurable (raw)]:
fixes f g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_inner}"
assumes "f \<in> borel_measurable M"
assumes "g \<in> borel_measurable M"
shows "(\<lambda>x. f x \<bullet> g x) \<in> borel_measurable M"
using assms
by (rule borel_measurable_continuous_Pair) (intro continuous_intros)
notation
eucl_less (infix "<e" 50)
lemma box_oc: "{x. a <e x \<and> x \<le> b} = {x. a <e x} \<inter> {..b}"
and box_co: "{x. a \<le> x \<and> x <e b} = {a..} \<inter> {x. x <e b}"
by auto
lemma eucl_ivals[measurable]:
fixes a b :: "'a::ordered_euclidean_space"
shows "{x. x <e a} \<in> sets borel"
and "{x. a <e x} \<in> sets borel"
and "{..a} \<in> sets borel"
and "{a..} \<in> sets borel"
and "{a..b} \<in> sets borel"
and "{x. a <e x \<and> x \<le> b} \<in> sets borel"
and "{x. a \<le> x \<and> x <e b} \<in> sets borel"
unfolding box_oc box_co
by (auto intro: borel_open borel_closed)
lemma
fixes i :: "'a::{second_countable_topology, real_inner}"
shows hafspace_less_borel: "{x. a < x \<bullet> i} \<in> sets borel"
and hafspace_greater_borel: "{x. x \<bullet> i < a} \<in> sets borel"
and hafspace_less_eq_borel: "{x. a \<le> x \<bullet> i} \<in> sets borel"
and hafspace_greater_eq_borel: "{x. x \<bullet> i \<le> a} \<in> sets borel"
by simp_all
lemma borel_eq_box:
"borel = sigma UNIV (range (\<lambda> (a, b). box a b :: 'a :: euclidean_space set))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI1[OF borel_def])
fix M :: "'a set" assume "M \<in> {S. open S}"
then have "open M" by simp
show "M \<in> ?SIGMA"
apply (subst open_UNION_box[OF \<open>open M\<close>])
apply (safe intro!: sets.countable_UN' countable_PiE countable_Collect)
apply (auto intro: countable_rat)
done
qed (auto simp: box_def)
lemma halfspace_gt_in_halfspace:
assumes i: "i \<in> A"
shows "{x::'a. a < x \<bullet> i} \<in>
sigma_sets UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. x \<bullet> i < a}) ` (UNIV \<times> A))"
(is "?set \<in> ?SIGMA")
proof -
interpret sigma_algebra UNIV ?SIGMA
by (intro sigma_algebra_sigma_sets) simp_all
have *: "?set = (\<Union>n. UNIV - {x::'a. x \<bullet> i < a + 1 / real (Suc n)})"
proof (safe, simp_all add: not_less del: of_nat_Suc)
fix x :: 'a assume "a < x \<bullet> i"
with reals_Archimedean[of "x \<bullet> i - a"]
obtain n where "a + 1 / real (Suc n) < x \<bullet> i"
by (auto simp: field_simps)
then show "\<exists>n. a + 1 / real (Suc n) \<le> x \<bullet> i"
by (blast intro: less_imp_le)
next
fix x n
have "a < a + 1 / real (Suc n)" by auto
also assume "\<dots> \<le> x"
finally show "a < x" .
qed
show "?set \<in> ?SIGMA" unfolding *
by (auto intro!: Diff sigma_sets_Inter i)
qed
lemma borel_eq_halfspace_less:
"borel = sigma UNIV ((\<lambda>(a, i). {x::'a::euclidean_space. x \<bullet> i < a}) ` (UNIV \<times> Basis))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI2[OF borel_eq_box])
fix a b :: 'a
have "box a b = {x\<in>space ?SIGMA. \<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i}"
by (auto simp: box_def)
also have "\<dots> \<in> sets ?SIGMA"
by (intro sets.sets_Collect_conj sets.sets_Collect_finite_All sets.sets_Collect_const)
(auto intro!: halfspace_gt_in_halfspace countable_PiE countable_rat)
finally show "box a b \<in> sets ?SIGMA" .
qed auto
lemma borel_eq_halfspace_le:
"borel = sigma UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. x \<bullet> i \<le> a}) ` (UNIV \<times> Basis))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less])
fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis"
then have i: "i \<in> Basis" by auto
have *: "{x::'a. x\<bullet>i < a} = (\<Union>n. {x. x\<bullet>i \<le> a - 1/real (Suc n)})"
proof (safe, simp_all del: of_nat_Suc)
fix x::'a assume *: "x\<bullet>i < a"
with reals_Archimedean[of "a - x\<bullet>i"]
obtain n where "x \<bullet> i < a - 1 / (real (Suc n))"
by (auto simp: field_simps)
then show "\<exists>n. x \<bullet> i \<le> a - 1 / (real (Suc n))"
by (blast intro: less_imp_le)
next
fix x::'a and n
assume "x\<bullet>i \<le> a - 1 / real (Suc n)"
also have "\<dots> < a" by auto
finally show "x\<bullet>i < a" .
qed
show "{x. x\<bullet>i < a} \<in> ?SIGMA" unfolding *
by (intro sets.countable_UN) (auto intro: i)
qed auto
lemma borel_eq_halfspace_ge:
"borel = sigma UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. a \<le> x \<bullet> i}) ` (UNIV \<times> Basis))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_less])
fix a :: real and i :: 'a assume i: "(a, i) \<in> UNIV \<times> Basis"
have *: "{x::'a. x\<bullet>i < a} = space ?SIGMA - {x::'a. a \<le> x\<bullet>i}" by auto
show "{x. x\<bullet>i < a} \<in> ?SIGMA" unfolding *
using i by (intro sets.compl_sets) auto
qed auto
lemma borel_eq_halfspace_greater:
"borel = sigma UNIV ((\<lambda> (a, i). {x::'a::euclidean_space. a < x \<bullet> i}) ` (UNIV \<times> Basis))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI2[OF borel_eq_halfspace_le])
fix a :: real and i :: 'a assume "(a, i) \<in> (UNIV \<times> Basis)"
then have i: "i \<in> Basis" by auto
have *: "{x::'a. x\<bullet>i \<le> a} = space ?SIGMA - {x::'a. a < x\<bullet>i}" by auto
show "{x. x\<bullet>i \<le> a} \<in> ?SIGMA" unfolding *
by (intro sets.compl_sets) (auto intro: i)
qed auto
lemma borel_eq_atMost:
"borel = sigma UNIV (range (\<lambda>a. {..a::'a::ordered_euclidean_space}))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le])
fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis"
then have "i \<in> Basis" by auto
then have *: "{x::'a. x\<bullet>i \<le> a} = (\<Union>k::nat. {.. (\<Sum>n\<in>Basis. (if n = i then a else real k)*\<^sub>R n)})"
proof (safe, simp_all add: eucl_le[where 'a='a] split: if_split_asm)
fix x :: 'a
obtain k where "Max ((\<bullet>) x ` Basis) \<le> real k"
using real_arch_simple by blast
then have "\<And>i. i \<in> Basis \<Longrightarrow> x\<bullet>i \<le> real k"
by (subst (asm) Max_le_iff) auto
then show "\<exists>k::nat. \<forall>ia\<in>Basis. ia \<noteq> i \<longrightarrow> x \<bullet> ia \<le> real k"
by (auto intro!: exI[of _ k])
qed
show "{x. x\<bullet>i \<le> a} \<in> ?SIGMA" unfolding *
by (intro sets.countable_UN) auto
qed auto
lemma borel_eq_greaterThan:
"borel = sigma UNIV (range (\<lambda>a::'a::ordered_euclidean_space. {x. a <e x}))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le])
fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis"
then have i: "i \<in> Basis" by auto
have "{x::'a. x\<bullet>i \<le> a} = UNIV - {x::'a. a < x\<bullet>i}" by auto
also have *: "{x::'a. a < x\<bullet>i} =
(\<Union>k::nat. {x. (\<Sum>n\<in>Basis. (if n = i then a else -real k) *\<^sub>R n) <e x})" using i
proof (safe, simp_all add: eucl_less_def split: if_split_asm)
fix x :: 'a
obtain k where k: "Max ((\<bullet>) (- x) ` Basis) < real k"
using reals_Archimedean2 by blast
{ fix i :: 'a assume "i \<in> Basis"
then have "-x\<bullet>i < real k"
using k by (subst (asm) Max_less_iff) auto
then have "- real k < x\<bullet>i" by simp }
then show "\<exists>k::nat. \<forall>ia\<in>Basis. ia \<noteq> i \<longrightarrow> -real k < x \<bullet> ia"
by (auto intro!: exI[of _ k])
qed
finally show "{x. x\<bullet>i \<le> a} \<in> ?SIGMA"
apply (simp only:)
apply (intro sets.countable_UN sets.Diff)
apply (auto intro: sigma_sets_top)
done
qed auto
lemma borel_eq_lessThan:
"borel = sigma UNIV (range (\<lambda>a::'a::ordered_euclidean_space. {x. x <e a}))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_ge])
fix a :: real and i :: 'a assume "(a, i) \<in> UNIV \<times> Basis"
then have i: "i \<in> Basis" by auto
have "{x::'a. a \<le> x\<bullet>i} = UNIV - {x::'a. x\<bullet>i < a}" by auto
also have *: "{x::'a. x\<bullet>i < a} = (\<Union>k::nat. {x. x <e (\<Sum>n\<in>Basis. (if n = i then a else real k) *\<^sub>R n)})" using \<open>i\<in> Basis\<close>
proof (safe, simp_all add: eucl_less_def split: if_split_asm)
fix x :: 'a
obtain k where k: "Max ((\<bullet>) x ` Basis) < real k"
using reals_Archimedean2 by blast
{ fix i :: 'a assume "i \<in> Basis"
then have "x\<bullet>i < real k"
using k by (subst (asm) Max_less_iff) auto
then have "x\<bullet>i < real k" by simp }
then show "\<exists>k::nat. \<forall>ia\<in>Basis. ia \<noteq> i \<longrightarrow> x \<bullet> ia < real k"
by (auto intro!: exI[of _ k])
qed
finally show "{x. a \<le> x\<bullet>i} \<in> ?SIGMA"
apply (simp only:)
apply (intro sets.countable_UN sets.Diff)
apply (auto intro: sigma_sets_top )
done
qed auto
lemma borel_eq_atLeastAtMost:
"borel = sigma UNIV (range (\<lambda>(a,b). {a..b} ::'a::ordered_euclidean_space set))"
(is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI5[OF borel_eq_atMost])
fix a::'a
have *: "{..a} = (\<Union>n::nat. {- real n *\<^sub>R One .. a})"
proof (safe, simp_all add: eucl_le[where 'a='a])
fix x :: 'a
obtain k where k: "Max ((\<bullet>) (- x) ` Basis) \<le> real k"
using real_arch_simple by blast
{ fix i :: 'a assume "i \<in> Basis"
with k have "- x\<bullet>i \<le> real k"
by (subst (asm) Max_le_iff) (auto simp: field_simps)
then have "- real k \<le> x\<bullet>i" by simp }
then show "\<exists>n::nat. \<forall>i\<in>Basis. - real n \<le> x \<bullet> i"
by (auto intro!: exI[of _ k])
qed
show "{..a} \<in> ?SIGMA" unfolding *
by (intro sets.countable_UN)
(auto intro!: sigma_sets_top)
qed auto
lemma borel_set_induct[consumes 1, case_names empty interval compl union]:
assumes "A \<in> sets borel"
assumes empty: "P {}" and int: "\<And>a b. a \<le> b \<Longrightarrow> P {a..b}" and compl: "\<And>A. A \<in> sets borel \<Longrightarrow> P A \<Longrightarrow> P (-A)" and
un: "\<And>f. disjoint_family f \<Longrightarrow> (\<And>i. f i \<in> sets borel) \<Longrightarrow> (\<And>i. P (f i)) \<Longrightarrow> P (\<Union>i::nat. f i)"
shows "P (A::real set)"
proof -
let ?G = "range (\<lambda>(a,b). {a..b::real})"
have "Int_stable ?G" "?G \<subseteq> Pow UNIV" "A \<in> sigma_sets UNIV ?G"
using assms(1) by (auto simp add: borel_eq_atLeastAtMost Int_stable_def)
thus ?thesis
proof (induction rule: sigma_sets_induct_disjoint)
case (union f)
from union.hyps(2) have "\<And>i. f i \<in> sets borel" by (auto simp: borel_eq_atLeastAtMost)
with union show ?case by (auto intro: un)
next
case (basic A)
then obtain a b where "A = {a .. b}" by auto
then show ?case
by (cases "a \<le> b") (auto intro: int empty)
qed (auto intro: empty compl simp: Compl_eq_Diff_UNIV[symmetric] borel_eq_atLeastAtMost)
qed
lemma borel_sigma_sets_Ioc: "borel = sigma UNIV (range (\<lambda>(a, b). {a <.. b::real}))"
proof (rule borel_eq_sigmaI5[OF borel_eq_atMost])
fix i :: real
have "{..i} = (\<Union>j::nat. {-j <.. i})"
by (auto simp: minus_less_iff reals_Archimedean2)
also have "\<dots> \<in> sets (sigma UNIV (range (\<lambda>(i, j). {i<..j})))"
by (intro sets.countable_nat_UN) auto
finally show "{..i} \<in> sets (sigma UNIV (range (\<lambda>(i, j). {i<..j})))" .
qed simp
lemma eucl_lessThan: "{x::real. x <e a} = lessThan a"
by (simp add: eucl_less_def lessThan_def)
lemma borel_eq_atLeastLessThan:
"borel = sigma UNIV (range (\<lambda>(a, b). {a ..< b :: real}))" (is "_ = ?SIGMA")
proof (rule borel_eq_sigmaI5[OF borel_eq_lessThan])
have move_uminus: "\<And>x y::real. -x \<le> y \<longleftrightarrow> -y \<le> x" by auto
fix x :: real
have "{..<x} = (\<Union>i::nat. {-real i ..< x})"
by (auto simp: move_uminus real_arch_simple)
then show "{y. y <e x} \<in> ?SIGMA"
by (auto intro: sigma_sets.intros(2-) simp: eucl_lessThan)
qed auto
lemma borel_measurable_halfspacesI:
fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
assumes F: "borel = sigma UNIV (F ` (UNIV \<times> Basis))"
and S_eq: "\<And>a i. S a i = f -` F (a,i) \<inter> space M"
shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a::real. S a i \<in> sets M)"
proof safe
fix a :: real and i :: 'b assume i: "i \<in> Basis" and f: "f \<in> borel_measurable M"
then show "S a i \<in> sets M" unfolding assms
by (auto intro!: measurable_sets simp: assms(1))
next
assume a: "\<forall>i\<in>Basis. \<forall>a. S a i \<in> sets M"
then show "f \<in> borel_measurable M"
by (auto intro!: measurable_measure_of simp: S_eq F)
qed
lemma borel_measurable_iff_halfspace_le:
fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. f w \<bullet> i \<le> a} \<in> sets M)"
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_le]) auto
lemma borel_measurable_iff_halfspace_less:
fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. f w \<bullet> i < a} \<in> sets M)"
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_less]) auto
lemma borel_measurable_iff_halfspace_ge:
fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
shows "f \<in> borel_measurable M = (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. a \<le> f w \<bullet> i} \<in> sets M)"
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_ge]) auto
lemma borel_measurable_iff_halfspace_greater:
fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i\<in>Basis. \<forall>a. {w \<in> space M. a < f w \<bullet> i} \<in> sets M)"
by (rule borel_measurable_halfspacesI[OF borel_eq_halfspace_greater]) auto
lemma borel_measurable_iff_le:
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w \<le> a} \<in> sets M)"
using borel_measurable_iff_halfspace_le[where 'c=real] by simp
lemma borel_measurable_iff_less:
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. f w < a} \<in> sets M)"
using borel_measurable_iff_halfspace_less[where 'c=real] by simp
lemma borel_measurable_iff_ge:
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a \<le> f w} \<in> sets M)"
using borel_measurable_iff_halfspace_ge[where 'c=real]
by simp
lemma borel_measurable_iff_greater:
"(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)"
using borel_measurable_iff_halfspace_greater[where 'c=real] by simp
lemma borel_measurable_euclidean_space:
fixes f :: "'a \<Rightarrow> 'c::euclidean_space"
shows "f \<in> borel_measurable M \<longleftrightarrow> (\<forall>i\<in>Basis. (\<lambda>x. f x \<bullet> i) \<in> borel_measurable M)"
proof safe
assume f: "\<forall>i\<in>Basis. (\<lambda>x. f x \<bullet> i) \<in> borel_measurable M"
then show "f \<in> borel_measurable M"
by (subst borel_measurable_iff_halfspace_le) auto
qed auto
subsection "Borel measurable operators"
lemma borel_measurable_norm[measurable]: "norm \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_sgn [measurable]: "(sgn::'a::real_normed_vector \<Rightarrow> 'a) \<in> borel_measurable borel"
by (rule borel_measurable_continuous_countable_exceptions[where X="{0}"])
(auto intro!: continuous_on_sgn continuous_on_id)
lemma borel_measurable_uminus[measurable (raw)]:
fixes g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
assumes g: "g \<in> borel_measurable M"
shows "(\<lambda>x. - g x) \<in> borel_measurable M"
by (rule borel_measurable_continuous_on[OF _ g]) (intro continuous_intros)
lemma borel_measurable_diff[measurable (raw)]:
fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
shows "(\<lambda>x. f x - g x) \<in> borel_measurable M"
using borel_measurable_add [of f M "- g"] assms by (simp add: fun_Compl_def)
lemma borel_measurable_times[measurable (raw)]:
fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_algebra}"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
shows "(\<lambda>x. f x * g x) \<in> borel_measurable M"
using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros)
lemma borel_measurable_prod[measurable (raw)]:
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> 'b::{second_countable_topology, real_normed_field}"
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
proof cases
assume "finite S"
thus ?thesis using assms by induct auto
qed simp
lemma borel_measurable_dist[measurable (raw)]:
fixes g f :: "'a \<Rightarrow> 'b::{second_countable_topology, metric_space}"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
shows "(\<lambda>x. dist (f x) (g x)) \<in> borel_measurable M"
using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros)
lemma borel_measurable_scaleR[measurable (raw)]:
fixes g :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
shows "(\<lambda>x. f x *\<^sub>R g x) \<in> borel_measurable M"
using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros)
lemma borel_measurable_uminus_eq [simp]:
fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, real_normed_vector}"
shows "(\<lambda>x. - f x) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M" (is "?l = ?r")
proof
assume ?l from borel_measurable_uminus[OF this] show ?r by simp
qed auto
lemma affine_borel_measurable_vector:
fixes f :: "'a \<Rightarrow> 'x::real_normed_vector"
assumes "f \<in> borel_measurable M"
shows "(\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M"
proof (rule borel_measurableI)
fix S :: "'x set" assume "open S"
show "(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M"
proof cases
assume "b \<noteq> 0"
with \<open>open S\<close> have "open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)" (is "open ?S")
using open_affinity [of S "inverse b" "- a /\<^sub>R b"]
by (auto simp: algebra_simps)
hence "?S \<in> sets borel" by auto
moreover
from \<open>b \<noteq> 0\<close> have "(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` ?S"
apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all)
ultimately show ?thesis using assms unfolding in_borel_measurable_borel
by auto
qed simp
qed
lemma borel_measurable_const_scaleR[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. b *\<^sub>R f x ::'a::real_normed_vector) \<in> borel_measurable M"
using affine_borel_measurable_vector[of f M 0 b] by simp
lemma borel_measurable_const_add[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. a + f x ::'a::real_normed_vector) \<in> borel_measurable M"
using affine_borel_measurable_vector[of f M a 1] by simp
lemma borel_measurable_inverse[measurable (raw)]:
fixes f :: "'a \<Rightarrow> 'b::real_normed_div_algebra"
assumes f: "f \<in> borel_measurable M"
shows "(\<lambda>x. inverse (f x)) \<in> borel_measurable M"
apply (rule measurable_compose[OF f])
apply (rule borel_measurable_continuous_countable_exceptions[of "{0}"])
apply (auto intro!: continuous_on_inverse continuous_on_id)
done
lemma borel_measurable_divide[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow>
(\<lambda>x. f x / g x::'b::{second_countable_topology, real_normed_div_algebra}) \<in> borel_measurable M"
by (simp add: divide_inverse)
lemma borel_measurable_abs[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. \<bar>f x :: real\<bar>) \<in> borel_measurable M"
unfolding abs_real_def by simp
lemma borel_measurable_nth[measurable (raw)]:
"(\<lambda>x::real^'n. x $ i) \<in> borel_measurable borel"
by (simp add: cart_eq_inner_axis)
lemma convex_measurable:
fixes A :: "'a :: euclidean_space set"
shows "X \<in> borel_measurable M \<Longrightarrow> X ` space M \<subseteq> A \<Longrightarrow> open A \<Longrightarrow> convex_on A q \<Longrightarrow>
(\<lambda>x. q (X x)) \<in> borel_measurable M"
by (rule measurable_compose[where f=X and N="restrict_space borel A"])
(auto intro!: borel_measurable_continuous_on_restrict convex_on_continuous measurable_restrict_space2)
lemma borel_measurable_ln[measurable (raw)]:
assumes f: "f \<in> borel_measurable M"
shows "(\<lambda>x. ln (f x :: real)) \<in> borel_measurable M"
apply (rule measurable_compose[OF f])
apply (rule borel_measurable_continuous_countable_exceptions[of "{0}"])
apply (auto intro!: continuous_on_ln continuous_on_id)
done
lemma borel_measurable_log[measurable (raw)]:
"f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. log (g x) (f x)) \<in> borel_measurable M"
unfolding log_def by auto
lemma borel_measurable_exp[measurable]:
"(exp::'a::{real_normed_field,banach}\<Rightarrow>'a) \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_at_imp_continuous_on ballI isCont_exp)
lemma measurable_real_floor[measurable]:
"(floor :: real \<Rightarrow> int) \<in> measurable borel (count_space UNIV)"
proof -
have "\<And>a x. \<lfloor>x\<rfloor> = a \<longleftrightarrow> (real_of_int a \<le> x \<and> x < real_of_int (a + 1))"
by (auto intro: floor_eq2)
then show ?thesis
by (auto simp: vimage_def measurable_count_space_eq2_countable)
qed
lemma measurable_real_ceiling[measurable]:
"(ceiling :: real \<Rightarrow> int) \<in> measurable borel (count_space UNIV)"
unfolding ceiling_def[abs_def] by simp
lemma borel_measurable_real_floor: "(\<lambda>x::real. real_of_int \<lfloor>x\<rfloor>) \<in> borel_measurable borel"
by simp
lemma borel_measurable_root [measurable]: "root n \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_sqrt [measurable]: "sqrt \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_power [measurable (raw)]:
fixes f :: "_ \<Rightarrow> 'b::{power,real_normed_algebra}"
assumes f: "f \<in> borel_measurable M"
shows "(\<lambda>x. (f x) ^ n) \<in> borel_measurable M"
by (intro borel_measurable_continuous_on [OF _ f] continuous_intros)
lemma borel_measurable_Re [measurable]: "Re \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_Im [measurable]: "Im \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_of_real [measurable]: "(of_real :: _ \<Rightarrow> (_::real_normed_algebra)) \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_sin [measurable]: "(sin :: _ \<Rightarrow> (_::{real_normed_field,banach})) \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_cos [measurable]: "(cos :: _ \<Rightarrow> (_::{real_normed_field,banach})) \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma borel_measurable_arctan [measurable]: "arctan \<in> borel_measurable borel"
by (intro borel_measurable_continuous_onI continuous_intros)
lemma\<^marker>\<open>tag important\<close> borel_measurable_complex_iff:
"f \<in> borel_measurable M \<longleftrightarrow>
(\<lambda>x. Re (f x)) \<in> borel_measurable M \<and> (\<lambda>x. Im (f x)) \<in> borel_measurable M"
apply auto
apply (subst fun_complex_eq)
apply (intro borel_measurable_add)
apply auto
done
lemma powr_real_measurable [measurable]:
assumes "f \<in> measurable M borel" "g \<in> measurable M borel"
shows "(\<lambda>x. f x powr g x :: real) \<in> measurable M borel"
using assms by (simp_all add: powr_def)
lemma measurable_of_bool[measurable]: "of_bool \<in> count_space UNIV \<rightarrow>\<^sub>M borel"
by simp
subsection "Borel space on the extended reals"
lemma borel_measurable_ereal[measurable (raw)]:
assumes f: "f \<in> borel_measurable M" shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M"
using continuous_on_ereal f by (rule borel_measurable_continuous_on) (rule continuous_on_id)
lemma borel_measurable_real_of_ereal[measurable (raw)]:
fixes f :: "'a \<Rightarrow> ereal"
assumes f: "f \<in> borel_measurable M"
shows "(\<lambda>x. real_of_ereal (f x)) \<in> borel_measurable M"
apply (rule measurable_compose[OF f])
apply (rule borel_measurable_continuous_countable_exceptions[of "{\<infinity>, -\<infinity> }"])
apply (auto intro: continuous_on_real simp: Compl_eq_Diff_UNIV)
done
lemma borel_measurable_ereal_cases:
fixes f :: "'a \<Rightarrow> ereal"
assumes f: "f \<in> borel_measurable M"
assumes H: "(\<lambda>x. H (ereal (real_of_ereal (f x)))) \<in> borel_measurable M"
shows "(\<lambda>x. H (f x)) \<in> borel_measurable M"
proof -
let ?F = "\<lambda>x. if f x = \<infinity> then H \<infinity> else if f x = - \<infinity> then H (-\<infinity>) else H (ereal (real_of_ereal (f x)))"
{ fix x have "H (f x) = ?F x" by (cases "f x") auto }
with f H show ?thesis by simp
qed
lemma
fixes f :: "'a \<Rightarrow> ereal" assumes f[measurable]: "f \<in> borel_measurable M"
shows borel_measurable_ereal_abs[measurable(raw)]: "(\<lambda>x. \<bar>f x\<bar>) \<in> borel_measurable M"
and borel_measurable_ereal_inverse[measurable(raw)]: "(\<lambda>x. inverse (f x) :: ereal) \<in> borel_measurable M"
and borel_measurable_uminus_ereal[measurable(raw)]: "(\<lambda>x. - f x :: ereal) \<in> borel_measurable M"
by (auto simp del: abs_real_of_ereal simp: borel_measurable_ereal_cases[OF f] measurable_If)
lemma borel_measurable_uminus_eq_ereal[simp]:
"(\<lambda>x. - f x :: ereal) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M" (is "?l = ?r")
proof
assume ?l from borel_measurable_uminus_ereal[OF this] show ?r by simp
qed auto
lemma set_Collect_ereal2:
fixes f g :: "'a \<Rightarrow> ereal"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
assumes H: "{x \<in> space M. H (ereal (real_of_ereal (f x))) (ereal (real_of_ereal (g x)))} \<in> sets M"
"{x \<in> space borel. H (-\<infinity>) (ereal x)} \<in> sets borel"
"{x \<in> space borel. H (\<infinity>) (ereal x)} \<in> sets borel"
"{x \<in> space borel. H (ereal x) (-\<infinity>)} \<in> sets borel"
"{x \<in> space borel. H (ereal x) (\<infinity>)} \<in> sets borel"
shows "{x \<in> space M. H (f x) (g x)} \<in> sets M"
proof -
let ?G = "\<lambda>y x. if g x = \<infinity> then H y \<infinity> else if g x = -\<infinity> then H y (-\<infinity>) else H y (ereal (real_of_ereal (g x)))"
let ?F = "\<lambda>x. if f x = \<infinity> then ?G \<infinity> x else if f x = -\<infinity> then ?G (-\<infinity>) x else ?G (ereal (real_of_ereal (f x))) x"
{ fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto }
note * = this
from assms show ?thesis
by (subst *) (simp del: space_borel split del: if_split)
qed
lemma borel_measurable_ereal_iff:
shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M"
proof
assume "(\<lambda>x. ereal (f x)) \<in> borel_measurable M"
from borel_measurable_real_of_ereal[OF this]
show "f \<in> borel_measurable M" by auto
qed auto
lemma borel_measurable_erealD[measurable_dest]:
"(\<lambda>x. ereal (f x)) \<in> borel_measurable M \<Longrightarrow> g \<in> measurable N M \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N"
unfolding borel_measurable_ereal_iff by simp
theorem borel_measurable_ereal_iff_real:
fixes f :: "'a \<Rightarrow> ereal"
shows "f \<in> borel_measurable M \<longleftrightarrow>
((\<lambda>x. real_of_ereal (f x)) \<in> borel_measurable M \<and> f -` {\<infinity>} \<inter> space M \<in> sets M \<and> f -` {-\<infinity>} \<inter> space M \<in> sets M)"
proof safe
assume *: "(\<lambda>x. real_of_ereal (f x)) \<in> borel_measurable M" "f -` {\<infinity>} \<inter> space M \<in> sets M" "f -` {-\<infinity>} \<inter> space M \<in> sets M"
have "f -` {\<infinity>} \<inter> space M = {x\<in>space M. f x = \<infinity>}" "f -` {-\<infinity>} \<inter> space M = {x\<in>space M. f x = -\<infinity>}" by auto
with * have **: "{x\<in>space M. f x = \<infinity>} \<in> sets M" "{x\<in>space M. f x = -\<infinity>} \<in> sets M" by simp_all
let ?f = "\<lambda>x. if f x = \<infinity> then \<infinity> else if f x = -\<infinity> then -\<infinity> else ereal (real_of_ereal (f x))"
have "?f \<in> borel_measurable M" using * ** by (intro measurable_If) auto
also have "?f = f" by (auto simp: fun_eq_iff ereal_real)
finally show "f \<in> borel_measurable M" .
qed simp_all
lemma borel_measurable_ereal_iff_Iio:
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {..< a} \<inter> space M \<in> sets M)"
by (auto simp: borel_Iio measurable_iff_measure_of)
lemma borel_measurable_ereal_iff_Ioi:
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a <..} \<inter> space M \<in> sets M)"
by (auto simp: borel_Ioi measurable_iff_measure_of)
lemma vimage_sets_compl_iff:
"f -` A \<inter> space M \<in> sets M \<longleftrightarrow> f -` (- A) \<inter> space M \<in> sets M"
proof -
{ fix A assume "f -` A \<inter> space M \<in> sets M"
moreover have "f -` (- A) \<inter> space M = space M - f -` A \<inter> space M" by auto
ultimately have "f -` (- A) \<inter> space M \<in> sets M" by auto }
from this[of A] this[of "-A"] show ?thesis
by (metis double_complement)
qed
lemma borel_measurable_iff_Iic_ereal:
"(f::'a\<Rightarrow>ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {..a} \<inter> space M \<in> sets M)"
unfolding borel_measurable_ereal_iff_Ioi vimage_sets_compl_iff[where A="{a <..}" for a] by simp
lemma borel_measurable_iff_Ici_ereal:
"(f::'a \<Rightarrow> ereal) \<in> borel_measurable M \<longleftrightarrow> (\<forall>a. f -` {a..} \<inter> space M \<in> sets M)"
unfolding borel_measurable_ereal_iff_Iio vimage_sets_compl_iff[where A="{..< a}" for a] by simp
lemma borel_measurable_ereal2:
fixes f g :: "'a \<Rightarrow> ereal"
assumes f: "f \<in> borel_measurable M"
assumes g: "g \<in> borel_measurable M"
assumes H: "(\<lambda>x. H (ereal (real_of_ereal (f x))) (ereal (real_of_ereal (g x)))) \<in> borel_measurable M"
"(\<lambda>x. H (-\<infinity>) (ereal (real_of_ereal (g x)))) \<in> borel_measurable M"
"(\<lambda>x. H (\<infinity>) (ereal (real_of_ereal (g x)))) \<in> borel_measurable M"
"(\<lambda>x. H (ereal (real_of_ereal (f x))) (-\<infinity>)) \<in> borel_measurable M"
"(\<lambda>x. H (ereal (real_of_ereal (f x))) (\<infinity>)) \<in> borel_measurable M"
shows "(\<lambda>x. H (f x) (g x)) \<in> borel_measurable M"
proof -
let ?G = "\<lambda>y x. if g x = \<infinity> then H y \<infinity> else if g x = - \<infinity> then H y (-\<infinity>) else H y (ereal (real_of_ereal (g x)))"
let ?F = "\<lambda>x. if f x = \<infinity> then ?G \<infinity> x else if f x = - \<infinity> then ?G (-\<infinity>) x else ?G (ereal (real_of_ereal (f x))) x"
{ fix x have "H (f x) (g x) = ?F x" by (cases "f x" "g x" rule: ereal2_cases) auto }
note * = this
from assms show ?thesis unfolding * by simp
qed
lemma [measurable(raw)]:
fixes f :: "'a \<Rightarrow> ereal"
assumes [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
shows borel_measurable_ereal_add: "(\<lambda>x. f x + g x) \<in> borel_measurable M"
and borel_measurable_ereal_times: "(\<lambda>x. f x * g x) \<in> borel_measurable M"
by (simp_all add: borel_measurable_ereal2)
lemma [measurable(raw)]:
fixes f g :: "'a \<Rightarrow> ereal"
assumes "f \<in> borel_measurable M"
assumes "g \<in> borel_measurable M"
shows borel_measurable_ereal_diff: "(\<lambda>x. f x - g x) \<in> borel_measurable M"
and borel_measurable_ereal_divide: "(\<lambda>x. f x / g x) \<in> borel_measurable M"
using assms by (simp_all add: minus_ereal_def divide_ereal_def)
lemma borel_measurable_ereal_sum[measurable (raw)]:
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal"
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M"
using assms by (induction S rule: infinite_finite_induct) auto
lemma borel_measurable_ereal_prod[measurable (raw)]:
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal"
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
using assms by (induction S rule: infinite_finite_induct) auto
lemma borel_measurable_extreal_suminf[measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> ereal"
assumes [measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "(\<lambda>x. (\<Sum>i. f i x)) \<in> borel_measurable M"
unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp
subsection "Borel space on the extended non-negative reals"
text \<open> \<^type>\<open>ennreal\<close> is a topological monoid, so no rules for plus are required, also all order
statements are usually done on type classes. \<close>
lemma measurable_enn2ereal[measurable]: "enn2ereal \<in> borel \<rightarrow>\<^sub>M borel"
by (intro borel_measurable_continuous_onI continuous_on_enn2ereal)
lemma measurable_e2ennreal[measurable]: "e2ennreal \<in> borel \<rightarrow>\<^sub>M borel"
by (intro borel_measurable_continuous_onI continuous_on_e2ennreal)
lemma borel_measurable_enn2real[measurable (raw)]:
"f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. enn2real (f x)) \<in> M \<rightarrow>\<^sub>M borel"
unfolding enn2real_def[abs_def] by measurable
definition\<^marker>\<open>tag important\<close> [simp]: "is_borel f M \<longleftrightarrow> f \<in> borel_measurable M"
lemma is_borel_transfer[transfer_rule]: "rel_fun (rel_fun (=) pcr_ennreal) (=) is_borel is_borel"
unfolding is_borel_def[abs_def]
proof (safe intro!: rel_funI ext dest!: rel_fun_eq_pcr_ennreal[THEN iffD1])
fix f and M :: "'a measure"
show "f \<in> borel_measurable M" if f: "enn2ereal \<circ> f \<in> borel_measurable M"
using measurable_compose[OF f measurable_e2ennreal] by simp
qed simp
context
includes ennreal.lifting
begin
lemma measurable_ennreal[measurable]: "ennreal \<in> borel \<rightarrow>\<^sub>M borel"
unfolding is_borel_def[symmetric]
by transfer simp
lemma borel_measurable_ennreal_iff[simp]:
assumes [simp]: "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x"
shows "(\<lambda>x. ennreal (f x)) \<in> M \<rightarrow>\<^sub>M borel \<longleftrightarrow> f \<in> M \<rightarrow>\<^sub>M borel"
proof safe
assume "(\<lambda>x. ennreal (f x)) \<in> M \<rightarrow>\<^sub>M borel"
then have "(\<lambda>x. enn2real (ennreal (f x))) \<in> M \<rightarrow>\<^sub>M borel"
by measurable
then show "f \<in> M \<rightarrow>\<^sub>M borel"
by (rule measurable_cong[THEN iffD1, rotated]) auto
qed measurable
lemma borel_measurable_times_ennreal[measurable (raw)]:
fixes f g :: "'a \<Rightarrow> ennreal"
shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x * g x) \<in> M \<rightarrow>\<^sub>M borel"
unfolding is_borel_def[symmetric] by transfer simp
lemma borel_measurable_inverse_ennreal[measurable (raw)]:
fixes f :: "'a \<Rightarrow> ennreal"
shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. inverse (f x)) \<in> M \<rightarrow>\<^sub>M borel"
unfolding is_borel_def[symmetric] by transfer simp
lemma borel_measurable_divide_ennreal[measurable (raw)]:
fixes f :: "'a \<Rightarrow> ennreal"
shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x / g x) \<in> M \<rightarrow>\<^sub>M borel"
unfolding divide_ennreal_def by simp
lemma borel_measurable_minus_ennreal[measurable (raw)]:
fixes f :: "'a \<Rightarrow> ennreal"
shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x - g x) \<in> M \<rightarrow>\<^sub>M borel"
unfolding is_borel_def[symmetric] by transfer simp
lemma borel_measurable_power_ennreal [measurable (raw)]:
fixes f :: "_ \<Rightarrow> ennreal"
assumes f: "f \<in> borel_measurable M"
shows "(\<lambda>x. (f x) ^ n) \<in> borel_measurable M"
by (induction n) (use f in auto)
lemma borel_measurable_prod_ennreal[measurable (raw)]:
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ennreal"
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
using assms by (induction S rule: infinite_finite_induct) auto
end
hide_const (open) is_borel
subsection \<open>LIMSEQ is borel measurable\<close>
lemma borel_measurable_LIMSEQ_real:
fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real"
assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) \<longlonglongrightarrow> u' x"
and u: "\<And>i. u i \<in> borel_measurable M"
shows "u' \<in> borel_measurable M"
proof -
have "\<And>x. x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n x)) = ereal (u' x)"
using u' by (simp add: lim_imp_Liminf)
moreover from u have "(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M"
by auto
ultimately show ?thesis by (simp cong: measurable_cong add: borel_measurable_ereal_iff)
qed
lemma borel_measurable_LIMSEQ_metric:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: metric_space"
assumes [measurable]: "\<And>i. f i \<in> borel_measurable M"
assumes lim: "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. f i x) \<longlonglongrightarrow> g x"
shows "g \<in> borel_measurable M"
unfolding borel_eq_closed
proof (safe intro!: measurable_measure_of)
fix A :: "'b set" assume "closed A"
have [measurable]: "(\<lambda>x. infdist (g x) A) \<in> borel_measurable M"
proof (rule borel_measurable_LIMSEQ_real)
show "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. infdist (f i x) A) \<longlonglongrightarrow> infdist (g x) A"
by (intro tendsto_infdist lim)
show "\<And>i. (\<lambda>x. infdist (f i x) A) \<in> borel_measurable M"
by (intro borel_measurable_continuous_on[where f="\<lambda>x. infdist x A"]
continuous_at_imp_continuous_on ballI continuous_infdist continuous_ident) auto
qed
show "g -` A \<inter> space M \<in> sets M"
proof cases
assume "A \<noteq> {}"
then have "\<And>x. infdist x A = 0 \<longleftrightarrow> x \<in> A"
using \<open>closed A\<close> by (simp add: in_closed_iff_infdist_zero)
then have "g -` A \<inter> space M = {x\<in>space M. infdist (g x) A = 0}"
by auto
also have "\<dots> \<in> sets M"
by measurable
finally show ?thesis .
qed simp
qed auto
lemma sets_Collect_Cauchy[measurable]:
fixes f :: "nat \<Rightarrow> 'a => 'b::{metric_space, second_countable_topology}"
assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "{x\<in>space M. Cauchy (\<lambda>i. f i x)} \<in> sets M"
unfolding metric_Cauchy_iff2 using f by auto
lemma borel_measurable_lim_metric[measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{banach, second_countable_topology}"
assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "(\<lambda>x. lim (\<lambda>i. f i x)) \<in> borel_measurable M"
proof -
define u' where "u' x = lim (\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0)" for x
then have *: "\<And>x. lim (\<lambda>i. f i x) = (if Cauchy (\<lambda>i. f i x) then u' x else (THE x. False))"
by (auto simp: lim_def convergent_eq_Cauchy[symmetric])
have "u' \<in> borel_measurable M"
proof (rule borel_measurable_LIMSEQ_metric)
fix x
have "convergent (\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0)"
by (cases "Cauchy (\<lambda>i. f i x)")
(auto simp add: convergent_eq_Cauchy[symmetric] convergent_def)
then show "(\<lambda>i. if Cauchy (\<lambda>i. f i x) then f i x else 0) \<longlonglongrightarrow> u' x"
unfolding u'_def
by (rule convergent_LIMSEQ_iff[THEN iffD1])
qed measurable
then show ?thesis
unfolding * by measurable
qed
lemma borel_measurable_suminf[measurable (raw)]:
fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{banach, second_countable_topology}"
assumes f[measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "(\<lambda>x. suminf (\<lambda>i. f i x)) \<in> borel_measurable M"
unfolding suminf_def sums_def[abs_def] lim_def[symmetric] by simp
lemma Collect_closed_imp_pred_borel: "closed {x. P x} \<Longrightarrow> Measurable.pred borel P"
by (simp add: pred_def)
(* Proof by Jeremy Avigad and Luke Serafin *)
lemma isCont_borel_pred[measurable]:
fixes f :: "'b::metric_space \<Rightarrow> 'a::metric_space"
shows "Measurable.pred borel (isCont f)"
proof (subst measurable_cong)
let ?I = "\<lambda>j. inverse(real (Suc j))"
show "isCont f x = (\<forall>i. \<exists>j. \<forall>y z. dist x y < ?I j \<and> dist x z < ?I j \<longrightarrow> dist (f y) (f z) \<le> ?I i)" for x
unfolding continuous_at_eps_delta
proof safe
fix i assume "\<forall>e>0. \<exists>d>0. \<forall>y. dist y x < d \<longrightarrow> dist (f y) (f x) < e"
moreover have "0 < ?I i / 2"
by simp
ultimately obtain d where d: "0 < d" "\<And>y. dist x y < d \<Longrightarrow> dist (f y) (f x) < ?I i / 2"
by (metis dist_commute)
then obtain j where j: "?I j < d"
by (metis reals_Archimedean)
show "\<exists>j. \<forall>y z. dist x y < ?I j \<and> dist x z < ?I j \<longrightarrow> dist (f y) (f z) \<le> ?I i"
proof (safe intro!: exI[where x=j])
fix y z assume *: "dist x y < ?I j" "dist x z < ?I j"
have "dist (f y) (f z) \<le> dist (f y) (f x) + dist (f z) (f x)"
by (rule dist_triangle2)
also have "\<dots> < ?I i / 2 + ?I i / 2"
by (intro add_strict_mono d less_trans[OF _ j] *)
also have "\<dots> \<le> ?I i"
by (simp add: field_simps)
finally show "dist (f y) (f z) \<le> ?I i"
by simp
qed
next
fix e::real assume "0 < e"
then obtain n where n: "?I n < e"
by (metis reals_Archimedean)
assume "\<forall>i. \<exists>j. \<forall>y z. dist x y < ?I j \<and> dist x z < ?I j \<longrightarrow> dist (f y) (f z) \<le> ?I i"
from this[THEN spec, of "Suc n"]
obtain j where j: "\<And>y z. dist x y < ?I j \<Longrightarrow> dist x z < ?I j \<Longrightarrow> dist (f y) (f z) \<le> ?I (Suc n)"
by auto
show "\<exists>d>0. \<forall>y. dist y x < d \<longrightarrow> dist (f y) (f x) < e"
proof (safe intro!: exI[of _ "?I j"])
fix y assume "dist y x < ?I j"
then have "dist (f y) (f x) \<le> ?I (Suc n)"
by (intro j) (auto simp: dist_commute)
also have "?I (Suc n) < ?I n"
by simp
also note n
finally show "dist (f y) (f x) < e" .
qed simp
qed
qed (intro pred_intros_countable closed_Collect_all closed_Collect_le open_Collect_less
Collect_closed_imp_pred_borel closed_Collect_imp open_Collect_conj continuous_intros)
lemma isCont_borel:
fixes f :: "'b::metric_space \<Rightarrow> 'a::metric_space"
shows "{x. isCont f x} \<in> sets borel"
by simp
lemma is_real_interval:
assumes S: "is_interval S"
shows "\<exists>a b::real. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or> S = {a<..} \<or> S = {a..} \<or>
S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}"
using S unfolding is_interval_1 by (blast intro: interval_cases)
lemma real_interval_borel_measurable:
assumes "is_interval (S::real set)"
shows "S \<in> sets borel"
proof -
from assms is_real_interval have "\<exists>a b::real. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or>
S = {a<..} \<or> S = {a..} \<or> S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}" by auto
then show ?thesis
by auto
qed
text \<open>The next lemmas hold in any second countable linorder (including ennreal or ereal for instance),
but in the current state they are restricted to reals.\<close>
lemma borel_measurable_mono_on_fnc:
fixes f :: "real \<Rightarrow> real" and A :: "real set"
assumes "mono_on A f"
shows "f \<in> borel_measurable (restrict_space borel A)"
apply (rule measurable_restrict_countable[OF mono_on_ctble_discont[OF assms]])
apply (auto intro!: image_eqI[where x="{x}" for x] simp: sets_restrict_space)
apply (auto simp add: sets_restrict_restrict_space continuous_on_eq_continuous_within
cong: measurable_cong_sets
intro!: borel_measurable_continuous_on_restrict intro: continuous_within_subset)
done
lemma borel_measurable_piecewise_mono:
fixes f::"real \<Rightarrow> real" and C::"real set set"
assumes "countable C" "\<And>c. c \<in> C \<Longrightarrow> c \<in> sets borel" "\<And>c. c \<in> C \<Longrightarrow> mono_on c f" "(\<Union>C) = UNIV"
shows "f \<in> borel_measurable borel"
by (rule measurable_piecewise_restrict[of C], auto intro: borel_measurable_mono_on_fnc simp: assms)
lemma borel_measurable_mono:
fixes f :: "real \<Rightarrow> real"
shows "mono f \<Longrightarrow> f \<in> borel_measurable borel"
using borel_measurable_mono_on_fnc[of UNIV f] by (simp add: mono_def mono_on_def)
lemma measurable_bdd_below_real[measurable (raw)]:
fixes F :: "'a \<Rightarrow> 'i \<Rightarrow> real"
assumes [simp]: "countable I" and [measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> M \<rightarrow>\<^sub>M borel"
shows "Measurable.pred M (\<lambda>x. bdd_below ((\<lambda>i. F i x)`I))"
proof (subst measurable_cong)
show "bdd_below ((\<lambda>i. F i x)`I) \<longleftrightarrow> (\<exists>q\<in>\<int>. \<forall>i\<in>I. q \<le> F i x)" for x
by (auto simp: bdd_below_def intro!: bexI[of _ "of_int (floor _)"] intro: order_trans of_int_floor_le)
show "Measurable.pred M (\<lambda>w. \<exists>q\<in>\<int>. \<forall>i\<in>I. q \<le> F i w)"
using countable_int by measurable
qed
lemma borel_measurable_cINF_real[measurable (raw)]:
fixes F :: "_ \<Rightarrow> _ \<Rightarrow> real"
assumes [simp]: "countable I"
assumes F[measurable]: "\<And>i. i \<in> I \<Longrightarrow> F i \<in> borel_measurable M"
shows "(\<lambda>x. INF i\<in>I. F i x) \<in> borel_measurable M"
proof (rule measurable_piecewise_restrict)
let ?\<Omega> = "{x\<in>space M. bdd_below ((\<lambda>i. F i x)`I)}"
show "countable {?\<Omega>, - ?\<Omega>}" "space M \<subseteq> \<Union>{?\<Omega>, - ?\<Omega>}" "\<And>X. X \<in> {?\<Omega>, - ?\<Omega>} \<Longrightarrow> X \<inter> space M \<in> sets M"
by auto
fix X assume "X \<in> {?\<Omega>, - ?\<Omega>}" then show "(\<lambda>x. INF i\<in>I. F i x) \<in> borel_measurable (restrict_space M X)"
proof safe
show "(\<lambda>x. INF i\<in>I. F i x) \<in> borel_measurable (restrict_space M ?\<Omega>)"
by (intro borel_measurable_cINF measurable_restrict_space1 F)
(auto simp: space_restrict_space)
show "(\<lambda>x. INF i\<in>I. F i x) \<in> borel_measurable (restrict_space M (-?\<Omega>))"
proof (subst measurable_cong)
fix x assume "x \<in> space (restrict_space M (-?\<Omega>))"
then have "\<not> (\<forall>i\<in>I. - F i x \<le> y)" for y
by (auto simp: space_restrict_space bdd_above_def bdd_above_uminus[symmetric])
then show "(INF i\<in>I. F i x) = - (THE x. False)"
by (auto simp: space_restrict_space Inf_real_def Sup_real_def Least_def simp del: Set.ball_simps(10))
qed simp
qed
qed
lemma borel_Ici: "borel = sigma UNIV (range (\<lambda>x::real. {x ..}))"
proof (safe intro!: borel_eq_sigmaI1[OF borel_Iio])
fix x :: real
have eq: "{..<x} = space (sigma UNIV (range atLeast)) - {x ..}"
by auto
show "{..<x} \<in> sets (sigma UNIV (range atLeast))"
unfolding eq by (intro sets.compl_sets) auto
qed auto
lemma borel_measurable_pred_less[measurable (raw)]:
fixes f :: "'a \<Rightarrow> 'b::{second_countable_topology, linorder_topology}"
shows "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> Measurable.pred M (\<lambda>w. f w < g w)"
unfolding Measurable.pred_def by (rule borel_measurable_less)
no_notation
eucl_less (infix "<e" 50)
lemma borel_measurable_Max2[measurable (raw)]:
fixes f::"_ \<Rightarrow> _ \<Rightarrow> 'a::{second_countable_topology, dense_linorder, linorder_topology}"
assumes "finite I"
and [measurable]: "\<And>i. f i \<in> borel_measurable M"
shows "(\<lambda>x. Max{f i x |i. i \<in> I}) \<in> borel_measurable M"
by (simp add: borel_measurable_Max[OF assms(1), where ?f=f and ?M=M] Setcompr_eq_image)
lemma measurable_compose_n [measurable (raw)]:
assumes "T \<in> measurable M M"
shows "(T^^n) \<in> measurable M M"
by (induction n, auto simp add: measurable_compose[OF _ assms])
lemma measurable_real_imp_nat:
fixes f::"'a \<Rightarrow> nat"
assumes [measurable]: "(\<lambda>x. real(f x)) \<in> borel_measurable M"
shows "f \<in> measurable M (count_space UNIV)"
proof -
let ?g = "(\<lambda>x. real(f x))"
have "\<And>(n::nat). ?g-`({real n}) \<inter> space M = f-`{n} \<inter> space M" by auto
moreover have "\<And>(n::nat). ?g-`({real n}) \<inter> space M \<in> sets M" using assms by measurable
ultimately have "\<And>(n::nat). f-`{n} \<inter> space M \<in> sets M" by simp
then show ?thesis using measurable_count_space_eq2_countable by blast
qed
lemma measurable_equality_set [measurable]:
fixes f g::"_\<Rightarrow> 'a::{second_countable_topology, t2_space}"
assumes [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
shows "{x \<in> space M. f x = g x} \<in> sets M"
proof -
define A where "A = {x \<in> space M. f x = g x}"
define B where "B = {y. \<exists>x::'a. y = (x,x)}"
have "A = (\<lambda>x. (f x, g x))-`B \<inter> space M" unfolding A_def B_def by auto
moreover have "(\<lambda>x. (f x, g x)) \<in> borel_measurable M" by simp
moreover have "B \<in> sets borel" unfolding B_def by (simp add: closed_diagonal)
ultimately have "A \<in> sets M" by simp
then show ?thesis unfolding A_def by simp
qed
lemma measurable_inequality_set [measurable]:
fixes f g::"_ \<Rightarrow> 'a::{second_countable_topology, linorder_topology}"
assumes [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
shows "{x \<in> space M. f x \<le> g x} \<in> sets M"
"{x \<in> space M. f x < g x} \<in> sets M"
"{x \<in> space M. f x \<ge> g x} \<in> sets M"
"{x \<in> space M. f x > g x} \<in> sets M"
proof -
define F where "F = (\<lambda>x. (f x, g x))"
have * [measurable]: "F \<in> borel_measurable M" unfolding F_def by simp
have "{x \<in> space M. f x \<le> g x} = F-`{(x, y) | x y. x \<le> y} \<inter> space M" unfolding F_def by auto
moreover have "{(x, y) | x y. x \<le> (y::'a)} \<in> sets borel" using closed_subdiagonal borel_closed by blast
ultimately show "{x \<in> space M. f x \<le> g x} \<in> sets M" using * by (metis (mono_tags, lifting) measurable_sets)
have "{x \<in> space M. f x < g x} = F-`{(x, y) | x y. x < y} \<inter> space M" unfolding F_def by auto
moreover have "{(x, y) | x y. x < (y::'a)} \<in> sets borel" using open_subdiagonal borel_open by blast
ultimately show "{x \<in> space M. f x < g x} \<in> sets M" using * by (metis (mono_tags, lifting) measurable_sets)
have "{x \<in> space M. f x \<ge> g x} = F-`{(x, y) | x y. x \<ge> y} \<inter> space M" unfolding F_def by auto
moreover have "{(x, y) | x y. x \<ge> (y::'a)} \<in> sets borel" using closed_superdiagonal borel_closed by blast
ultimately show "{x \<in> space M. f x \<ge> g x} \<in> sets M" using * by (metis (mono_tags, lifting) measurable_sets)
have "{x \<in> space M. f x > g x} = F-`{(x, y) | x y. x > y} \<inter> space M" unfolding F_def by auto
moreover have "{(x, y) | x y. x > (y::'a)} \<in> sets borel" using open_superdiagonal borel_open by blast
ultimately show "{x \<in> space M. f x > g x} \<in> sets M" using * by (metis (mono_tags, lifting) measurable_sets)
qed
proposition measurable_limit [measurable]:
fixes f::"nat \<Rightarrow> 'a \<Rightarrow> 'b::first_countable_topology"
assumes [measurable]: "\<And>n::nat. f n \<in> borel_measurable M"
shows "Measurable.pred M (\<lambda>x. (\<lambda>n. f n x) \<longlonglongrightarrow> c)"
proof -
obtain A :: "nat \<Rightarrow> 'b set" where A:
"\<And>i. open (A i)"
"\<And>i. c \<in> A i"
"\<And>S. open S \<Longrightarrow> c \<in> S \<Longrightarrow> eventually (\<lambda>i. A i \<subseteq> S) sequentially"
by (rule countable_basis_at_decseq) blast
have [measurable]: "\<And>N i. (f N)-`(A i) \<inter> space M \<in> sets M" using A(1) by auto
then have mes: "(\<Inter>i. \<Union>n. \<Inter>N\<in>{n..}. (f N)-`(A i) \<inter> space M) \<in> sets M" by blast
have "(u \<longlonglongrightarrow> c) \<longleftrightarrow> (\<forall>i. eventually (\<lambda>n. u n \<in> A i) sequentially)" for u::"nat \<Rightarrow> 'b"
proof
assume "u \<longlonglongrightarrow> c"
then have "eventually (\<lambda>n. u n \<in> A i) sequentially" for i using A(1)[of i] A(2)[of i]
by (simp add: topological_tendstoD)
then show "(\<forall>i. eventually (\<lambda>n. u n \<in> A i) sequentially)" by auto
next
assume H: "(\<forall>i. eventually (\<lambda>n. u n \<in> A i) sequentially)"
show "(u \<longlonglongrightarrow> c)"
proof (rule topological_tendstoI)
fix S assume "open S" "c \<in> S"
with A(3)[OF this] obtain i where "A i \<subseteq> S"
using eventually_False_sequentially eventually_mono by blast
moreover have "eventually (\<lambda>n. u n \<in> A i) sequentially" using H by simp
ultimately show "\<forall>\<^sub>F n in sequentially. u n \<in> S"
by (simp add: eventually_mono subset_eq)
qed
qed
then have "{x. (\<lambda>n. f n x) \<longlonglongrightarrow> c} = (\<Inter>i. \<Union>n. \<Inter>N\<in>{n..}. (f N)-`(A i))"
by (auto simp add: atLeast_def eventually_at_top_linorder)
then have "{x \<in> space M. (\<lambda>n. f n x) \<longlonglongrightarrow> c} = (\<Inter>i. \<Union>n. \<Inter>N\<in>{n..}. (f N)-`(A i) \<inter> space M)"
by auto
then have "{x \<in> space M. (\<lambda>n. f n x) \<longlonglongrightarrow> c} \<in> sets M" using mes by simp
then show ?thesis by auto
qed
lemma measurable_limit2 [measurable]:
fixes u::"nat \<Rightarrow> 'a \<Rightarrow> real"
assumes [measurable]: "\<And>n. u n \<in> borel_measurable M" "v \<in> borel_measurable M"
shows "Measurable.pred M (\<lambda>x. (\<lambda>n. u n x) \<longlonglongrightarrow> v x)"
proof -
define w where "w = (\<lambda>n x. u n x - v x)"
have [measurable]: "w n \<in> borel_measurable M" for n unfolding w_def by auto
have "((\<lambda>n. u n x) \<longlonglongrightarrow> v x) \<longleftrightarrow> ((\<lambda>n. w n x) \<longlonglongrightarrow> 0)" for x
unfolding w_def using Lim_null by auto
then show ?thesis using measurable_limit by auto
qed
lemma measurable_P_restriction [measurable (raw)]:
assumes [measurable]: "Measurable.pred M P" "A \<in> sets M"
shows "{x \<in> A. P x} \<in> sets M"
proof -
have "A \<subseteq> space M" using sets.sets_into_space[OF assms(2)].
then have "{x \<in> A. P x} = A \<inter> {x \<in> space M. P x}" by blast
then show ?thesis by auto
qed
lemma measurable_sum_nat [measurable (raw)]:
fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> nat"
assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> measurable M (count_space UNIV)"
shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> measurable M (count_space UNIV)"
proof cases
assume "finite S"
then show ?thesis using assms by induct auto
qed simp
lemma measurable_abs_powr [measurable]:
fixes p::real
assumes [measurable]: "f \<in> borel_measurable M"
shows "(\<lambda>x. \<bar>f x\<bar> powr p) \<in> borel_measurable M"
by simp
text \<open>The next one is a variation around \<open>measurable_restrict_space\<close>.\<close>
lemma measurable_restrict_space3:
assumes "f \<in> measurable M N" and
"f \<in> A \<rightarrow> B"
shows "f \<in> measurable (restrict_space M A) (restrict_space N B)"
proof -
have "f \<in> measurable (restrict_space M A) N" using assms(1) measurable_restrict_space1 by auto
then show ?thesis by (metis Int_iff funcsetI funcset_mem
measurable_restrict_space2[of f, of "restrict_space M A", of B, of N] assms(2) space_restrict_space)
qed
lemma measurable_restrict_mono:
assumes f: "f \<in> restrict_space M A \<rightarrow>\<^sub>M N" and "B \<subseteq> A"
shows "f \<in> restrict_space M B \<rightarrow>\<^sub>M N"
by (rule measurable_compose[OF measurable_restrict_space3 f])
(insert \<open>B \<subseteq> A\<close>, auto)
text \<open>The next one is a variation around \<open>measurable_piecewise_restrict\<close>.\<close>
lemma measurable_piecewise_restrict2:
assumes [measurable]: "\<And>n. A n \<in> sets M"
and "space M = (\<Union>(n::nat). A n)"
"\<And>n. \<exists>h \<in> measurable M N. (\<forall>x \<in> A n. f x = h x)"
shows "f \<in> measurable M N"
proof (rule measurableI)
fix B assume [measurable]: "B \<in> sets N"
{
fix n::nat
obtain h where [measurable]: "h \<in> measurable M N" and "\<forall>x \<in> A n. f x = h x" using assms(3) by blast
then have *: "f-`B \<inter> A n = h-`B \<inter> A n" by auto
have "h-`B \<inter> A n = h-`B \<inter> space M \<inter> A n" using assms(2) sets.sets_into_space by auto
then have "h-`B \<inter> A n \<in> sets M" by simp
then have "f-`B \<inter> A n \<in> sets M" using * by simp
}
then have "(\<Union>n. f-`B \<inter> A n) \<in> sets M" by measurable
moreover have "f-`B \<inter> space M = (\<Union>n. f-`B \<inter> A n)" using assms(2) by blast
ultimately show "f-`B \<inter> space M \<in> sets M" by simp
next
fix x assume "x \<in> space M"
then obtain n where "x \<in> A n" using assms(2) by blast
obtain h where [measurable]: "h \<in> measurable M N" and "\<forall>x \<in> A n. f x = h x" using assms(3) by blast
then have "f x = h x" using \<open>x \<in> A n\<close> by blast
moreover have "h x \<in> space N" by (metis measurable_space \<open>x \<in> space M\<close> \<open>h \<in> measurable M N\<close>)
ultimately show "f x \<in> space N" by simp
qed
end
|
##plots=group
##showplots
##Layer=vector
##Value=field Layer
boxplot(Layer[[Value]], col="red", main="Cajas y Bigotes") |
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: GPL-2.0-only
*)
theory AutoCorresModifiesProofs
imports
"L4VerifiedLinks"
"CLib.SIMPL_Lemmas"
begin
text \<open>
Generate modifies specs, i.e. specifications of which globals fields
may potentially be modified by each function.
It turns out that ac_corres is not strong enough to automagically
transfer C-parser's modifies theorems across to the AutoCorres functions.
This is because the modifies specs are unconditional, whereas our
ac_corres theorems have preconditions on the initial states.
In other words, the modifies spec is a syntactic property of a function
rather than a semantic one. Fortunately, this also makes it straightforward
to prove them from scratch over our newly-generated functions.
\<close>
section \<open>Rules for modifies proof method\<close>
text \<open>
Transferring modifies rules for un-translated functions.
These functions are defined to be equivalent to their SIMPL specs
(via L1_call_simpl), so the limitations of ac_corres do not apply.
\<close>
lemma autocorres_modifies_transfer:
notes select_wp[wp] hoare_seq_ext[wp]
fixes \<Gamma> globals f' f_'proc modifies_eqn P xf
assumes f'_def: "f' \<equiv> AC_call_L1 P globals xf (L1_call_simpl check_termination \<Gamma> f_'proc)"
assumes f_modifies: "\<forall>\<sigma>. \<Gamma>\<turnstile>\<^bsub>/UNIV\<^esub> {\<sigma>} Call f_'proc {t. modifies_eqn (globals t) (globals \<sigma>)}"
shows "\<lbrace> \<lambda>s. s = \<sigma> \<rbrace> f' \<lbrace> \<lambda>_ s. modifies_eqn s \<sigma> \<rbrace>"
apply (clarsimp simp: f'_def AC_call_L1_def L2_call_L1_def L1_call_simpl_def)
apply (simp add: liftM_def bind_assoc)
apply wpsimp
apply (clarsimp simp: in_monad select_def split: xstate.splits)
by (case_tac xa; clarsimp dest!: exec_normal[OF singletonI _ f_modifies[rule_format]])
text \<open>
A monadic Hoare triple for a modifies spec looks like
"\<lbrace>\<lambda>s. s = \<sigma>\<rbrace> prog \<lbrace>\<lambda>s. \<exists>x1 x2... s = \<sigma>\<lparr>field1 := x1, ...\<rparr>\<rbrace>"
where (fieldk, xk) are the possibly-modified fields.
To prove it, we rewrite the precondition to an invariant:
\<lbrace>\<lambda>s. \<exists>x1 x2... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace> prog \<lbrace>\<lambda>_ s. \<exists>x1 x2... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace>
Then we carry the invariant through each statement of the program.
\<close>
text \<open>
Adapter for apply rules to an invariant goal.
We allow "I" and "I'" to be different (in our modifies proof, "I"
will have \<exists>-quantified vars lifted out).
\<close>
lemma valid_inv_weaken:
"\<lbrakk> valid P f (\<lambda>_. R); \<And>s. I s \<Longrightarrow> P s; \<And>s. R s \<Longrightarrow> I' s \<rbrakk> \<Longrightarrow> valid I f (\<lambda>_. I')"
by (fastforce simp: valid_def)
text \<open>
Our function modifies rules have a schematic precond,
so this rule avoids weakening the invariant when applying those rules
and ending up with an underspecified P.
\<close>
lemma valid_inv_weaken':
"\<lbrakk> valid I f (\<lambda>_. Q); \<And>s. Q s \<Longrightarrow> I' s \<rbrakk> \<Longrightarrow> valid I f (\<lambda>_. I')"
by (rule valid_inv_weaken)
text \<open>
Used by modifies_initial_tac to instantiate a schematic precondition
to an invariant.
\<close>
lemma valid_invI:
"valid I f (\<lambda>_. I) \<Longrightarrow> valid I f (\<lambda>_. I)"
by -
text \<open>For rewriting foralls in premises.\<close>
lemma All_to_all:
"Trueprop (\<forall>x. P x) \<equiv> (\<And>x. P x)"
by presburger
subsection \<open>Hoare rules for state invariants\<close>
named_theorems valid_inv
lemmas [valid_inv] =
fail_inv
gets_inv
return_inv
hoare_K_bind
lemma when_inv[valid_inv]:
"\<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> when c f \<lbrace>\<lambda>_. I\<rbrace>"
apply wp
apply auto
done
lemma bind_inv[valid_inv]:
"\<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> (\<And>x. \<lbrace>I\<rbrace> g x \<lbrace>\<lambda>_. I\<rbrace>) \<Longrightarrow> \<lbrace>I\<rbrace> f >>= g \<lbrace>\<lambda>_. I\<rbrace>"
apply (wp; assumption)
done
lemma guard_inv[valid_inv]:
"\<lbrace>I\<rbrace> guard G \<lbrace>\<lambda>_. I\<rbrace>"
by (fastforce simp: valid_def)
lemma modify_inv[valid_inv]:
"(\<And>s. I s \<Longrightarrow> I (f s)) \<Longrightarrow> \<lbrace>I\<rbrace> modify f \<lbrace>\<lambda>_. I\<rbrace>"
apply wp
by simp
lemma skip_inv[valid_inv]:
"\<lbrace>I\<rbrace> skip \<lbrace>\<lambda>_. I\<rbrace>"
by (rule skip_wp)
lemma select_inv[valid_inv]:
"\<lbrace>I\<rbrace> select f \<lbrace>\<lambda>_. I\<rbrace>"
by (rule hoare_weaken_pre, rule select_wp, blast)
lemma condition_inv[valid_inv]:
"\<lbrace>I\<rbrace> t \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> condition c t f\<lbrace>\<lambda>_. I\<rbrace>"
apply (rule hoare_weaken_pre)
apply (rule condition_wp)
apply auto
done
lemma whileLoop_inv[valid_inv]:
"\<lbrakk>\<And>r. \<lbrace>I\<rbrace> b r \<lbrace>\<lambda>_. I\<rbrace> \<rbrakk> \<Longrightarrow> \<lbrace>I\<rbrace> whileLoop c b r \<lbrace>\<lambda>_. I\<rbrace>"
apply (rule whileLoop_wp)
apply (blast intro: hoare_weaken_pre)
apply assumption
done
lemma valid_case_prod_inv[valid_inv]:
"(\<And>x y. \<lbrace>I\<rbrace> f x y \<lbrace>\<lambda>_. I\<rbrace>) \<Longrightarrow> \<lbrace>I\<rbrace> case v of (x, y) \<Rightarrow> f x y \<lbrace>\<lambda>_. I\<rbrace>"
apply wp
apply auto
done
lemma unknown_inv[valid_inv]:
"\<lbrace>I\<rbrace> unknown \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold unknown_def)
apply (rule select_inv)
done
lemma throwError_inv[valid_inv]:
"\<lbrace>I\<rbrace> throwError e \<lbrace>\<lambda>_. I\<rbrace>"
by wp
lemma catch_inv[valid_inv]:
"\<lbrakk> \<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace>; \<And>e. \<lbrace>I\<rbrace> h e \<lbrace>\<lambda>_. I\<rbrace> \<rbrakk> \<Longrightarrow> \<lbrace>I\<rbrace> catch f h \<lbrace>\<lambda>_. I\<rbrace>"
apply wpsimp
apply assumption
apply (simp add: validE_def)
by assumption
lemma whileLoopE_inv[valid_inv]:
"(\<And>r. \<lbrace>I\<rbrace> b r \<lbrace>\<lambda>_. I\<rbrace>) \<Longrightarrow> \<lbrace>I\<rbrace> whileLoopE c b r \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold whileLoopE_def)
apply (rule whileLoop_inv)
apply (auto simp: lift_def split: sum.splits intro: throwError_inv)
done
lemma bindE_inv[valid_inv]:
"\<lbrakk> \<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace>; \<And>x. \<lbrace>I\<rbrace> g x \<lbrace>\<lambda>_. I\<rbrace> \<rbrakk> \<Longrightarrow> \<lbrace>I\<rbrace> f >>=E g \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold bindE_def)
apply (rule bind_inv)
apply (auto simp: lift_def split: sum.splits intro: throwError_inv)
done
lemma returnOk_inv[valid_inv]:
"\<lbrace>I\<rbrace> returnOk x \<lbrace>\<lambda>_. I\<rbrace>"
apply (simp add: returnOk_def)
done
lemma liftE_inv[valid_inv]:
"\<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> liftE f \<lbrace>\<lambda>_. I\<rbrace>"
by wp
lemma getsE_inv[valid_inv]:
"\<lbrace>I\<rbrace> getsE f \<lbrace>\<lambda>r. I\<rbrace>"
apply (unfold getsE_def)
apply (blast intro: liftE_inv gets_inv)
done
lemma skipE_inv[valid_inv]:
"\<lbrace>I\<rbrace> skipE \<lbrace>\<lambda>r. I\<rbrace>"
apply (unfold skipE_def)
apply (blast intro: liftE_inv returnOk_inv)
done
lemma modifyE_inv[valid_inv]:
"(\<And>s. I s \<Longrightarrow> I (f s)) \<Longrightarrow> \<lbrace>I\<rbrace> modifyE f \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold modifyE_def)
apply (blast intro: liftE_inv modify_inv)
done
lemma guardE_inv[valid_inv]:
"\<lbrace>I\<rbrace> guardE G \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold guardE_def)
apply (blast intro: liftE_inv guard_inv)
done
lemma whenE_inv[valid_inv]:
"\<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> whenE c f \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold whenE_def)
apply (auto intro: returnOk_inv)
done
lemma unless_inv[valid_inv]:
"\<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> unless c f \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold unless_def)
by (rule when_inv)
lemma unlessE_inv[valid_inv]:
"\<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace> \<Longrightarrow> \<lbrace>I\<rbrace> unlessE c f \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold unlessE_def)
by (auto intro: returnOk_inv)
lemma handleE'_inv[valid_inv]:
"\<lbrakk> \<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace>; \<And>e. \<lbrace>I\<rbrace> h e \<lbrace>\<lambda>_. I\<rbrace> \<rbrakk> \<Longrightarrow> \<lbrace>I\<rbrace> handleE' f h \<lbrace>\<lambda>_. I\<rbrace>"
by (fastforce simp: handleE'_def intro: return_inv bind_inv split: sum.splits)
lemma handleE_inv[valid_inv]:
"\<lbrakk> \<lbrace>I\<rbrace> f \<lbrace>\<lambda>_. I\<rbrace>; \<And>e. \<lbrace>I\<rbrace> h e \<lbrace>\<lambda>_. I\<rbrace> \<rbrakk> \<Longrightarrow> \<lbrace>I\<rbrace> handleE f h \<lbrace>\<lambda>_. I\<rbrace>"
apply (unfold handleE_def)
by (rule handleE'_inv)
text \<open>@{term measure_call} appears in AutoCorres-generated calls to recursive functions.\<close>
lemma measure_call_inv[valid_inv]:
"\<lbrakk>\<And>m. \<lbrace>I\<rbrace> f m \<lbrace>\<lambda>_. I\<rbrace>\<rbrakk> \<Longrightarrow> \<lbrace>I\<rbrace> measure_call f \<lbrace>\<lambda>_. I\<rbrace>"
by (fastforce simp: measure_call_def valid_def)
text \<open>
Recursion base case for AutoCorres-generated specs.
NB: we don't make this valid_inv because it conflicts with bind_inv.
Instead we apply it manually.
\<close>
lemma modifies_recursive_0: "\<lbrace>I\<rbrace> do guard (\<lambda>_. (0 :: nat) < 0); f od \<lbrace>\<lambda>_. I\<rbrace>"
by simp
text \<open>These rules are currently sufficient for all the kernel code.\<close>
thm valid_inv
section \<open>Modifies proof procedure\<close>
text \<open>
The most important assumptions are currently:
- skip_heap_abs is set; we don't deal with lifted_globals
- all functions are translated to the nondet_monad
- we assume a specific format of modifies rule from the C-parser
(see comment for gen_modifies_prop)
- function_name_prefix="" and function_name_suffix="'" as per default
(FIXME: get these from function_info once it's been fixed)
The top-level procedure gets all kernel functions in topological order,
then does the modifies proofs for each function (or recursive function group).
The "scope" option should be supported (TODO: but not yet tested) and
in that case the C-parser modifies rules will be transferred directly.
\<close>
ML \<open>
structure AutoCorresModifiesProofs = struct
(* Translate a term, top-down, stopping once a conversion has been applied.
* trans is an assoc-list of terms to translate.
* Bound vars in trans are interpreted relative to outside t. *)
fun translate_term trans t = case assoc (trans, t) of SOME t' => t' | NONE =>
case t of f $ x => translate_term trans f $ translate_term trans x
| Abs (v, vT, b) => Abs (v, vT, translate_term (map (apply2 (incr_boundvars 1)) trans) b)
| _ => t;
(* Remove "Hoare.meq" and "Hoare.mex" scaffolding from SIMPL modifies specs *)
fun modifies_simp ctxt =
Conv.fconv_rule
(Raw_Simplifier.rewrite ctxt true
@{thms meq_def[THEN eq_reflection] mex_def[THEN eq_reflection]});
fun modifies_simp_term ctxt =
Raw_Simplifier.rewrite_term (Proof_Context.theory_of ctxt)
@{thms meq_def[THEN eq_reflection] mex_def[THEN eq_reflection]} [];
(* Translate c-parser's "modifies" specs of the form
* \<forall>\<sigma>. \<Gamma>\<turnstile>\<^bsub>/UNIV\<^esub> {\<sigma>} Call f_'proc {t. mex x1... meq (globals t) ((globals s)\<lparr>f1 := x1...\<rparr>)}
* to specs on the AutoCorres-generated monad
* \<lbrace>\<lambda>s. s = \<sigma>\<rbrace> f' \<lbrace>\<lambda>_ s. \<exists>x1... \<sigma> = s\<lparr>f1 := x1...\<rparr>\<rbrace>
*
* This involves:
* - talking about the "globals" state instead of "globals myvars"
* - removing "meq" and "mex" which are unnecessary for our proof method
* and have buggy syntax translations
* - using the monadic hoare predicate
*
* Returns tuple of (state var, function arg vars, measure var, prop).
* The returned vars are Free in the prop; the measure var is NONE for non-recursive functions.
*)
fun gen_modifies_prop ctxt
(fn_info: FunctionInfo.function_info Symtab.table)
(prog_info: ProgramInfo.prog_info) f_name c_prop = let
val f_info = the (Symtab.lookup fn_info f_name);
val globals_type = #globals_type prog_info;
val globals_term = #globals_getter prog_info;
val ac_ret_type = #return_type f_info;
val state0_var = Free ("\<sigma>", globals_type);
val @{term_pat "Trueprop (\<forall>\<sigma>. _\<turnstile>\<^bsub>/UNIV\<^esub> {\<sigma>} Call ?f_'proc {t. ?c_modifies_eqn})"} = c_prop;
(* Bound 0 = s, Bound 1 = \<sigma> in c_prop *)
val modifies_eqn = c_modifies_eqn |> translate_term
[(globals_term $ Bound 0, Bound 0), (globals_term $ Bound 1, state0_var)];
val modifies_postcond = Abs (Name.uu_, ac_ret_type, Abs ("s", globals_type, modifies_eqn))
|> modifies_simp_term ctxt;
val arg_vars = map Free (#args f_info);
val measure_var = if FunctionInfo.is_function_recursive f_info
(* will not clash with arg_vars as C identifiers do not contain primes *)
then SOME (Free ("measure'", @{typ nat})) else NONE;
val f_const = #const f_info
val f_call = betapplys (f_const, (case measure_var of SOME v => [v] | NONE => []) @ arg_vars);
val modifies_prop = @{mk_term "Trueprop (\<lbrace>\<lambda>s. s = ?state\<rbrace> ?call \<lbrace>?postcond\<rbrace>)" (state, call, postcond)}
(state0_var, f_call, modifies_postcond);
in (state0_var, arg_vars, measure_var, modifies_prop) end;
(* Solve invariant goals of the form
* \<And>s. (\<exists>x1 x2... s = \<sigma>\<lparr>field1 := x1, field2 := x2, ...\<rparr>) \<Longrightarrow>
* (\<exists>x1 x2... f s = \<sigma>\<lparr>field1 := x1, field2 := x2, ...\<rparr>)
* where f is some update function (usually id, but for modify statements
* it is the modifying function).
* We assume that s is all-quantified and \<sigma> is free. *)
fun modifies_invariant_tac quiet_fail ctxt n st = if Thm.nprems_of st = 0 then no_tac st else let
val globals_typ = Syntax.read_typ ctxt "globals";
val globals_cases = Proof_Context.get_thm ctxt "globals.cases";
val globals_splits = hd (Proof_Context.get_thms ctxt "globals.splits");
(* The fastest way (so far) is manually splitting s and \<sigma>, then simplifying.
* The Isar analogue would be
* elim exE, case_tac "s", case_tac "\<sigma>", simp
*)
(* \<sigma> is free, so obtaining the split rule is straightforward *)
val sigma_free = Free ("\<sigma>", globals_typ);
val case_sigma = Drule.infer_instantiate' ctxt [SOME (Thm.cterm_of ctxt sigma_free)] globals_cases;
(* However, s is bound and accessing it requires some awkward contortions *)
(* globals.splits is an equation that looks like
* (\<And>r. ?P r) \<equiv> (\<And>fields... ?P {fields})
* We walk down the current goal and apply globals.splits to the quantifier for the correct s.
* The correct s would be the one that appears in our invariant assumption of the form
* s = \<sigma>\<lparr>updates...\<rparr>
* (We removed the preceding \<exists>'s using exE beforehand.) *)
fun split_s_tac st = let
val subgoal = Logic.get_goal (Thm.prop_of st) n;
val prems = Logic.strip_assums_hyp subgoal;
val env = Term.strip_all_vars subgoal |> map snd |> rev;
fun find @{term_pat "Trueprop (?s = _)"} =
(case s of Bound s_idx => if fastype_of1 (env, s) = globals_typ then [s_idx] else []
| _ => [])
| find _ = []
val s_idx = case maps find prems of
[] => raise THM ("modifies_invariant_tac: failed to find invariant assumption", n, [st])
| idx::_ => idx;
fun split_conv idx (Const ("Pure.all", _) $ Abs (_, _, body)) ct =
if idx > s_idx then Conv.forall_conv (fn _ => split_conv (idx - 1) body) ctxt ct else let
val (_, cP) = Thm.dest_comb ct
val inst = Drule.infer_instantiate' ctxt [SOME cP] globals_splits
(*val _ = @{trace} (cP, inst, case Thm.prop_of inst of @{term_pat "?x \<equiv> _"} => x, Thm.term_of ct);*)
in inst end
| split_conv _ _ ct = Conv.no_conv ct; (* shouldn't happen *)
in Conv.gconv_rule (split_conv (length env - 1) subgoal) n st |> Seq.single end
handle e as THM _ => if quiet_fail then no_tac st else Exn.reraise e;
(* avoid contextual rules, like split_pair_Ex, that lead simp down the garden path *)
val globals_record_simps = maps (Proof_Context.get_thms ctxt) ["globals.ext_inject", "globals.update_convs"];
in st |>
(DETERM (REPEAT (eresolve_tac ctxt @{thms exE} n)) THEN
split_s_tac THEN
resolve_tac ctxt [case_sigma] n THEN
SOLVES (asm_full_simp_tac (put_simpset HOL_ss ctxt addsimps globals_record_simps) n))
end
(* Convert initial modifies goal of the form
* \<lbrace>\<lambda>s. s = \<sigma>\<rbrace> prog \<lbrace>\<lambda>_ s. \<exists>x1... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace>
* to one where the modifies is expressed as an invariant:
* \<lbrace>\<lambda>s. \<exists>x1... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace> prog \<lbrace>\<lambda>_ s. \<exists>x1... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace>
*)
fun modifies_initial_tac ctxt n =
resolve_tac ctxt @{thms hoare_weaken_pre} n THEN
resolve_tac ctxt @{thms valid_invI} n;
(* Incremental nets. (Why isn't this standard??) *)
type incr_net = (int * thm) Net.net * int;
fun build_incr_net rls = (Tactic.build_net rls, length rls);
fun add_to_incr_net th (net, sz) =
(Net.insert_term (K false) (Thm.concl_of th, (sz + 1, th)) net, sz + 1); (* guessed from tactic.ML *)
fun net_of (n: incr_net) = fst n;
(* Apply a callee's modifies rule to its call site.
* The current goal should be expressed as an invariant:
* \<lbrace>\<lambda>s. \<exists>x1... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace> f args... \<lbrace>\<lambda>_ s. \<exists>x1... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace>
* We assume that callee_modifies contains the correct modifies rule
* and is unique (no backtracking).
*)
fun modifies_call_tac (callee_modifies: incr_net) ctxt n = DETERM (
(* We move the existentials out of the precondition:
\<And>x1... \<lbrace>\<lambda>s. s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace> f args... \<lbrace>\<lambda>_ s. \<exists>x1... s = \<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace> *)
REPEAT (resolve_tac ctxt @{thms hoare_ex_pre} n) THEN
resolve_tac ctxt @{thms valid_inv_weaken'} n THEN
(* Then we can apply the modifies rule, which looks like:
\<lbrace>\<lambda>s. s = ?\<sigma>\<rbrace> f ?args... \<lbrace>\<lambda>_ s. \<exists>x1... s = ?\<sigma>\<lparr>field1 := x1, ...\<rparr> \<rbrace> *)
DETERM (resolve_from_net_tac ctxt (net_of callee_modifies) n) THEN
modifies_invariant_tac true ctxt n);
(* VCG for trivial state invariants, such as globals modifies specs.
* Takes vcg rules from "valid_inv". *)
val valid_invN = Context.theory_name @{theory} ^ ".valid_inv"
fun modifies_vcg_tac leaf_tac ctxt n = let
val vcg_rules = Named_Theorems.get ctxt valid_invN |> Tactic.build_net;
fun vcg n st = Seq.make (fn () => let
(* do not backtrack once we have matched vcg_rules *)
val st' = DETERM (resolve_from_net_tac ctxt vcg_rules n) st;
in Seq.pull ((case Seq.pull st' of
NONE => leaf_tac ctxt n
| SOME _ => (K (K st') THEN_ALL_NEW vcg) n) st) end);
in vcg n end;
(* Specify and prove modifies for one (non-recursive) function. *)
fun do_modifies_one ctxt fn_info (prog_info: ProgramInfo.prog_info) callee_modifies f_name = let
val c_modifies_prop = Thm.prop_of (Proof_Context.get_thm ctxt (f_name ^ "_modifies"));
val (state0_var, arg_vars, measure_var, ac_modifies_prop) =
gen_modifies_prop ctxt fn_info prog_info f_name c_modifies_prop;
val _ = if isSome measure_var then error ("do_modifies_one bug: got recursive function " ^ f_name) else ();
val f_def = the (Symtab.lookup fn_info f_name) |> #definition;
fun leaf_tac ctxt n = FIRST [modifies_call_tac callee_modifies ctxt n, modifies_invariant_tac true ctxt n,
print_tac ctxt ("do_modifies_one failed (goal " ^ string_of_int n ^ ")")];
val thm = Goal.prove ctxt (map (fn (Free (v, _)) => v) (state0_var :: arg_vars)) [] ac_modifies_prop
(K (Method.NO_CONTEXT_TACTIC ctxt (Method.unfold [f_def] ctxt []) THEN
modifies_initial_tac ctxt 1 THEN
modifies_vcg_tac leaf_tac ctxt 1 THEN
leaf_tac ctxt 1));
in thm end;
(* Make a list of conjunctions. *)
fun mk_conj_list [] = @{term "HOL.True"}
| mk_conj_list [x] = x
| mk_conj_list (x::xs) = HOLogic.mk_conj (x, (mk_conj_list xs))
(* Specify and prove modifies for a recursive function group. *)
fun do_modifies_recursive ctxt fn_info (prog_info: ProgramInfo.prog_info) (callee_modifies: incr_net) f_names = let
(* Collect information *)
val c_modifies_props = map (fn f_name => Thm.prop_of (Proof_Context.get_thm ctxt (f_name ^ "_modifies"))) f_names;
val modifies_props =
map2 (gen_modifies_prop ctxt fn_info prog_info) f_names c_modifies_props;
val f_defs = map (fn f_name => the (Symtab.lookup fn_info f_name) |> #definition) f_names;
fun free_name (Free (v, _)) = v;
(*
* We do the proof in three parts.
*
* First, we prove modifies on the base case (measure' = 0) for each function.
* This is trivially handled by @{thm modifies_recursive_0}.
*)
val base_case_props =
map (fn (state0_var, arg_vars, SOME measure_var, prop) =>
(state0_var, arg_vars, subst_free [(measure_var, @{term "0 :: nat"})] prop))
modifies_props;
val base_case_leaf_tac = modifies_invariant_tac true;
val base_case_thms =
map2 (fn (state0_var, arg_vars, prop) => fn f_def =>
Goal.prove ctxt (map free_name (state0_var :: arg_vars)) [] prop
(K (EqSubst.eqsubst_tac ctxt [0] [f_def] 1 THEN
modifies_initial_tac ctxt 1 THEN
resolve_tac ctxt @{thms modifies_recursive_0} 1 THEN
base_case_leaf_tac ctxt 1)))
base_case_props f_defs;
(*
* Next, we prove the induction step "measure'" \<rightarrow> "Suc measure'".
* We create an induction hypothesis for each function, quantifying
* over its variables:
* \<And>\<sigma> arg1 arg2... \<lbrace>\<lambda>s. s = \<sigma>\<rbrace> f measure' arg1 arg2... \<lbrace>\<lambda>s. \<exists>x1... s = \<sigma>\<lparr>f1 := x1...\<rparr>\<rbrace>
* Then, we can perform the VCG-based proof as usual, using these
* hypotheses in modifies_call_tac.
*)
val inductive_hyps =
map (fn (state0_var, arg_vars, SOME measure_var, prop) =>
fold Logic.all (state0_var :: arg_vars) prop)
modifies_props;
val inductive_props =
map (fn (state0_var, arg_vars, SOME measure_var, prop) =>
(state0_var, arg_vars, measure_var, subst_free [(measure_var, @{term "Suc"} $ measure_var)] prop))
modifies_props;
val inductive_thms =
map2 (fn (state0_var, arg_vars, measure_var, prop) => fn f_def =>
Goal.prove ctxt (map free_name (state0_var :: measure_var :: arg_vars)) inductive_hyps prop
(fn {context, prems} => let
val callee_modifies' = fold add_to_incr_net prems callee_modifies;
fun inductive_leaf_tac ctxt n =
FIRST [modifies_call_tac callee_modifies' ctxt n, modifies_invariant_tac true ctxt n];
in EqSubst.eqsubst_tac ctxt [0] [f_def] 1 THEN
(* AutoCorres specifies recursive calls to use "measure - 1",
* which in our case becomes "Suc measure - 1". Simplify to "measure". *)
Method.NO_CONTEXT_TACTIC ctxt (Method.unfold @{thms diff_Suc_1} ctxt []) THEN
modifies_initial_tac ctxt 1 THEN
modifies_vcg_tac inductive_leaf_tac ctxt 1 THEN
inductive_leaf_tac ctxt 1 end))
inductive_props f_defs
(*
* Third, we create a combined modifies prop
* (\<forall>\<sigma> arg1... \<lbrace>\<lambda>s. s = \<sigma>\<rbrace> f1 measure' arg1... \<lbrace>...\<rbrace>) \<and>
* (\<forall>\<sigma> arg1... \<lbrace>\<lambda>s. s = \<sigma>\<rbrace> f2 measure' arg1... \<lbrace>...\<rbrace>) \<and> ...
* and apply induction on measure', solving the subgoals using the
* theorems from before.
* Note that we quantify over args because arg names may clash between functions.
*
* We pre-proved the induction steps separately for convenience
* (e.g. so we can access the hypotheses as facts instead of premises).
*)
fun hd_of_equal [x] = x
| hd_of_equal (x::xs) = if forall (fn x' => x = x') xs then x else
raise TERM ("do_modifies_group bug: unequal terms", xs);
val (measure_var, final_props) =
modifies_props
|> map (fn (state0_var, arg_vars, SOME measure_var, prop) =>
(measure_var,
fold (fn Free (v, T) => fn P => HOLogic.mk_all (v, T, P))
(state0_var :: arg_vars) (HOLogic.dest_Trueprop prop)))
|> (fn xs => let
val props = map snd xs;
val measure_var = map fst xs |> hd_of_equal;
in (measure_var, props) end);
val combined_prop = HOLogic.mk_Trueprop (mk_conj_list final_props);
fun intro_tac ctxt rls n = TRY ((resolve_tac ctxt rls THEN_ALL_NEW intro_tac ctxt rls) n);
fun elim_tac ctxt rls n = TRY ((eresolve_tac ctxt rls THEN_ALL_NEW elim_tac ctxt rls) n);
(*fun maybe_print_tac msg ctxt = print_tac ctxt msg;*)
fun maybe_print_tac msg ctxt = all_tac;
(*val _ = @{trace} ("inductive thms", inductive_thms);*)
val combined_thm =
Goal.prove ctxt [free_name measure_var] [] combined_prop
(K (Induct.induct_tac ctxt
false (* simplifier *)
[[SOME (NONE, (measure_var, false))]] (* variables *)
[] (* arbitrary: *)
[] (* ??? *)
(SOME @{thms nat.induct}) (* induct rule *)
[] (* extra thms *)
1
THEN
maybe_print_tac "base case" ctxt THEN
(* base case *)
SOLVES (
(((DETERM o intro_tac ctxt @{thms conjI allI})
THEN' K (maybe_print_tac "base case'" ctxt))
THEN_ALL_NEW resolve_tac ctxt base_case_thms) 1
) THEN
maybe_print_tac "inductive case" ctxt THEN
(* recursive case *)
SOLVE (
(((DETERM o (intro_tac ctxt @{thms conjI allI} THEN_ALL_NEW
elim_tac ctxt @{thms conjE}) THEN_ALL_NEW
(fn n => Conv.gconv_rule
(Raw_Simplifier.rewrite ctxt true @{thms All_to_all}) n
#> Seq.succeed))
THEN' K (maybe_print_tac "inductive case'" ctxt))
THEN_ALL_NEW (resolve_tac ctxt inductive_thms THEN_ALL_NEW Method.assm_tac ctxt)) 1
)));
(* Finally, we extract theorems for individual functions. *)
val final_thms =
HOLogic.conj_elims ctxt combined_thm
|> map (fn thm =>
thm
|> Thm.equal_elim (Raw_Simplifier.rewrite ctxt true @{thms All_to_all} (Thm.cprop_of thm))
|> Thm.forall_elim_vars 0);
in final_thms end;
(* Prove and store modifies rules for one function or recursive function group. *)
fun prove_modifies
(fn_info: FunctionInfo.function_info Symtab.table)
(prog_info: ProgramInfo.prog_info)
(callee_modifies: incr_net)
(results: thm Symtab.table)
(f_names: string list)
(thm_names: string list)
ctxt
: (thm list * Proof.context) option = let
val f_infos = map (the o Symtab.lookup fn_info) f_names;
val maybe_thms =
if length f_names = 1 andalso #is_simpl_wrapper (hd f_infos)
then let
val f_name = hd f_names;
val _ = tracing (f_name ^ " is un-translated; transferring C-parser's modifies rule directly");
val f_def = the (Symtab.lookup fn_info f_name) |> #definition;
val orig_modifies = Proof_Context.get_thm ctxt (f_name ^ "_modifies");
val transfer_thm = @{thm autocorres_modifies_transfer};
val thm = transfer_thm OF [f_def, orig_modifies];
in SOME [modifies_simp ctxt thm] end
else let
val callees = map (FunctionInfo.all_callees o the o Symtab.lookup fn_info) f_names
|> Symset.union_sets |> Symset.dest;
val missing_callees = callees |> filter_out (fn callee =>
Symtab.defined results callee orelse member (=) f_names callee);
in if not (null missing_callees)
then (warning ("Can't prove modifies; depends on functions without modifies proofs: " ^
commas missing_callees);
NONE)
else if length f_names = 1
then SOME ([do_modifies_one ctxt fn_info prog_info callee_modifies (hd f_names)])
else SOME (do_modifies_recursive ctxt fn_info prog_info callee_modifies f_names) end;
in case maybe_thms of
SOME thms => let
val (_, ctxt) = Local_Theory.notes (map2 (fn thm_name => fn thm =>
((Binding.name thm_name, []), [([thm], [])])) thm_names thms) ctxt;
in SOME (thms, ctxt) end
| NONE => NONE
end;
fun define_modifies_group fn_info prog_info f_names (acc as (callee_modifies, results, ctxt)) =
(tracing ("Doing modifies proof for: " ^ commas f_names);
case f_names |> filter (fn f_name =>
not (isSome (try (Proof_Context.get_thm ctxt) (f_name ^ "_modifies")))) of
[] =>
(case prove_modifies fn_info prog_info
callee_modifies results f_names
(map (fn f_name => f_name ^ "'_modifies") f_names) ctxt of
NONE => acc
| SOME (thms, ctxt') => (fold add_to_incr_net thms callee_modifies,
fold Symtab.update_new (f_names ~~ thms) results, ctxt'))
| missing =>
(warning ("Can't do proof because C-parser modifies rules are missing for: " ^ commas missing);
acc));
(*
* This is the top-level wrapper that generates modifies rules for the most
* recently translated set of functions from a given C file.
*)
fun new_modifies_rules filename ctxt = let
val all_fn_info = Symtab.lookup (AutoCorresFunctionInfo.get (Proof_Context.theory_of ctxt)) filename |> the;
val ts_info = FunctionInfo.Phasetab.lookup all_fn_info FunctionInfo.TS |> the;
val prog_info = ProgramInfo.get_prog_info ctxt filename;
(* Assume that the user has already generated and named modifies rules
* for previously-translated callees. *)
val existing_modifies =
Symtab.dest ts_info
|> List.mapPartial (fn (fn_name, fn_def) =>
try (fn _ => (fn_name, Proof_Context.get_thm ctxt (fn_name ^ "'_modifies"))) ())
|> Symtab.make;
(* We will do modifies proofs for these functions *)
val pending_fn_info =
Symtab.dest ts_info
|> List.mapPartial (fn (f, info) =>
if Symtab.defined existing_modifies f then NONE else SOME (f, info))
|> Symtab.make;
val (call_graph, _) = FunctionInfo.calc_call_graph pending_fn_info;
val (callee_modifies, results, ctxt') =
fold (define_modifies_group ts_info prog_info)
(#topo_sorted_functions call_graph |> map Symset.dest)
(build_incr_net (Symtab.dest existing_modifies |> map snd),
existing_modifies, ctxt)
in ctxt' end
end;
\<close>
end
|
State Before: m : Type u_1 β Type u_2
Ο Ξ±β : Type u_1
p : Ξ±β β Prop
x : ReaderT Ο m Ξ±β
instβ : Monad m
a : ReaderT Ο m { a // p a }
β’ Subtype.val <$> a = x β β (x_1 : Ο), Subtype.val <$> a x_1 = x x_1 State After: no goals Tactic: exact β¨fun eq _ => eq βΈ rfl, funextβ© |
lemma Complex_in_Reals: "Complex x 0 \<in> \<real>" |
(* Definitions for public key encryption. *)
Set Implicit Arguments.
Require Import Crypto.
Local Open Scope rat_scope.
Section IND_CPA.
Variable Plaintext : Set.
Variable Ciphertext : Set.
Variable PrivateKey : Set.
Variable PublicKey : Set.
Variable KeyGen : Comp (PrivateKey * PublicKey).
Variable Encrypt : Plaintext -> PublicKey -> Comp Ciphertext.
Variable A_state : Set.
Variable A1 : PublicKey -> Comp (Plaintext * Plaintext * A_state).
Variable A2 : (Ciphertext * A_state) -> Comp bool.
Definition IND_CPA_G :=
[prikey, pubkey] <-$2 KeyGen;
[p0, p1, a_state] <-$3 (A1 pubkey);
b <-$ {0, 1};
pb <- if b then p0 else p1;
c <-$ (Encrypt pb pubkey);
b' <-$ (A2 (c, a_state));
ret (eqb b b').
Definition IND_CPA_Advantage := | Pr[IND_CPA_G] - 1 / 2 |.
Definition IND_CPA (epsilon : Rat) :=
| Pr[IND_CPA_G] - 1 / 2 | <= epsilon.
End IND_CPA.
|
> module Nat.DivisorOperations
> import Nat.Divisor
> %default total
> %access public export
> ||| Exact integer division
> quotient : (m : Nat) -> (d : Nat) -> d `Divisor` m -> Nat
> quotient _ _ (Element q _) = q
|
lemma zero_le_sgn_iff [simp]: "0 \<le> sgn x \<longleftrightarrow> 0 \<le> x" for x :: real |
module Main
greet : Eff () [STDIO]
greet = do putStrLn "Hello world"
putStrLn "What is your name?"
x <- getStr
putStrLn ("Welcome, " ++ trim x)
main : IO ()
main = run greet
--Run:
--$ idris greet.idr -o greet
--$ ./greet |
[GOAL]
Ο : Type u
K : Type v
instβ : Field K
I : Ideal (MvPolynomial Ο K)
hI : I β β€
β’ Function.Injective β(RingHom.comp (Ideal.Quotient.mk I) C)
[PROOFSTEP]
refine' (injective_iff_map_eq_zero _).2 fun x hx => _
[GOAL]
Ο : Type u
K : Type v
instβ : Field K
I : Ideal (MvPolynomial Ο K)
hI : I β β€
x : K
hx : β(RingHom.comp (Ideal.Quotient.mk I) C) x = 0
β’ x = 0
[PROOFSTEP]
rw [RingHom.comp_apply, Ideal.Quotient.eq_zero_iff_mem] at hx
[GOAL]
Ο : Type u
K : Type v
instβ : Field K
I : Ideal (MvPolynomial Ο K)
hI : I β β€
x : K
hx : βC x β I
β’ x = 0
[PROOFSTEP]
refine' _root_.by_contradiction fun hx0 => absurd (I.eq_top_iff_one.2 _) hI
[GOAL]
Ο : Type u
K : Type v
instβ : Field K
I : Ideal (MvPolynomial Ο K)
hI : I β β€
x : K
hx : βC x β I
hx0 : Β¬x = 0
β’ 1 β I
[PROOFSTEP]
have := I.mul_mem_left (MvPolynomial.C xβ»ΒΉ) hx
[GOAL]
Ο : Type u
K : Type v
instβ : Field K
I : Ideal (MvPolynomial Ο K)
hI : I β β€
x : K
hx : βC x β I
hx0 : Β¬x = 0
this : βC xβ»ΒΉ * βC x β I
β’ 1 β I
[PROOFSTEP]
rwa [β MvPolynomial.C.map_mul, inv_mul_cancel hx0, MvPolynomial.C_1] at this
[GOAL]
Ο K : Type u
instβ : Field K
β’ Module.rank K (MvPolynomial Ο K) = Cardinal.mk (Ο ββ β)
[PROOFSTEP]
rw [β Cardinal.lift_inj, β (basisMonomials Ο K).mk_eq_rank]
|
import float.basic
-- Following https://isabelle.in.tum.de/website-Isabelle2013/dist/library/HOL/HOL-Library/Float.html
variable (prec : β)
def round_up (x : β) : π½ :=
float.mk (βx * 2 ^ precβ) (-prec)
def round_down (x : β) : π½ :=
float.mk (βx * 2 ^ precβ) (-prec)
lemma round_up_zero : round_up prec 0 = 0 :=
by { apply quotient.sound, show to_rat _ = _, simp [to_rat], }
lemma round_down_zero : round_down prec 0 = 0 :=
by { apply quotient.sound, show to_rat _ = _, simp [to_rat], }
lemma round_up_diff_round_down (x : β)
: round_up prec x - round_down prec x β€ float.mk 1 (-prec) :=
begin
show float.eval _ β€ _,
simp [float.eval_sub, round_up, round_down, float.eval_mk],
suffices hsuff : β(βx * 2 ^ precβ - βx * 2 ^ precβ) * ((2 : β) ^ prec)β»ΒΉ β€ 1 * ((2 : β) ^ prec)β»ΒΉ,
{ push_cast at hsuff, rw [sub_mul, one_mul] at hsuff, exact hsuff, },
have h : 0 < ((2 : β) ^ prec)β»ΒΉ,
{ norm_num, },
rw [mul_le_mul_right h], show _ β€ β(1 : β€), simp [coe],
rw [sub_le_iff_le_add, add_comm],
exact ceil_le_floor_add_one _,
end
|
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
h : Inducing f
β’ Inducing (restrictPreimage s f)
[PROOFSTEP]
simp_rw [inducing_subtype_val.inducing_iff, inducing_iff_nhds, restrictPreimage, MapsTo.coe_restrict, restrict_eq, β
@Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h β’
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
h : β (a : Ξ±), π a = comap f (π (f a))
β’ β (a : β(f β»ΒΉ' s)), π a = comap Subtype.val (comap f (π (f βa)))
[PROOFSTEP]
intro a
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
h : β (a : Ξ±), π a = comap f (π (f a))
a : β(f β»ΒΉ' s)
β’ π a = comap Subtype.val (comap f (π (f βa)))
[PROOFSTEP]
rw [β h, β inducing_subtype_val.nhds_eq_comap]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
β’ IsClosedMap (restrictPreimage s f)
[PROOFSTEP]
rintro t β¨u, hu, eβ©
[GOAL]
case mk.intro.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
β’ IsClosed (restrictPreimage s f '' t)
[PROOFSTEP]
refine' β¨β¨_, (H _ (IsOpen.isClosed_compl hu)).1, _β©β©
[GOAL]
case mk.intro.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
β’ Subtype.val β»ΒΉ' (f '' uαΆ)αΆ = (restrictPreimage s f '' t)αΆ
[PROOFSTEP]
rw [β (congr_arg HasCompl.compl e).trans (compl_compl t)]
[GOAL]
case mk.intro.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
β’ Subtype.val β»ΒΉ' (f '' uαΆ)αΆ = (restrictPreimage s f '' (Subtype.val β»ΒΉ' u)αΆ)αΆ
[PROOFSTEP]
simp only [Set.preimage_compl, compl_inj_iff]
[GOAL]
case mk.intro.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
β’ Subtype.val β»ΒΉ' (f '' uαΆ) = restrictPreimage s f '' (Subtype.val β»ΒΉ' u)αΆ
[PROOFSTEP]
ext β¨x, hxβ©
[GOAL]
case mk.intro.intro.h.mk
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
x : Ξ²
hx : x β s
β’ { val := x, property := hx } β Subtype.val β»ΒΉ' (f '' uαΆ) β
{ val := x, property := hx } β restrictPreimage s f '' (Subtype.val β»ΒΉ' u)αΆ
[PROOFSTEP]
suffices (β y, y β u β§ f y = x) β β y, y β u β§ f y β s β§ f y = x by simpa [Set.restrictPreimage, β Subtype.coe_inj]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
x : Ξ²
hx : x β s
this : (β y, Β¬y β u β§ f y = x) β β y, Β¬y β u β§ f y β s β§ f y = x
β’ { val := x, property := hx } β Subtype.val β»ΒΉ' (f '' uαΆ) β
{ val := x, property := hx } β restrictPreimage s f '' (Subtype.val β»ΒΉ' u)αΆ
[PROOFSTEP]
simpa [Set.restrictPreimage, β Subtype.coe_inj]
[GOAL]
case mk.intro.intro.h.mk
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : IsClosedMap f
t : Set β(f β»ΒΉ' s)
u : Set Ξ±
hu : IsOpen u
e : Subtype.val β»ΒΉ' u = tαΆ
x : Ξ²
hx : x β s
β’ (β y, Β¬y β u β§ f y = x) β β y, Β¬y β u β§ f y β s β§ f y = x
[PROOFSTEP]
exact β¨fun β¨a, b, cβ© => β¨a, b, c.symm βΈ hx, cβ©, fun β¨a, b, _, cβ© => β¨a, b, cβ©β©
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
β’ IsOpen s β β (i : ΞΉ), IsOpen (s β© β(U i))
[PROOFSTEP]
constructor
[GOAL]
case mp
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
β’ IsOpen s β β (i : ΞΉ), IsOpen (s β© β(U i))
[PROOFSTEP]
exact fun H i => H.inter (U i).2
[GOAL]
case mpr
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
β’ (β (i : ΞΉ), IsOpen (s β© β(U i))) β IsOpen s
[PROOFSTEP]
intro H
[GOAL]
case mpr
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : β (i : ΞΉ), IsOpen (s β© β(U i))
β’ IsOpen s
[PROOFSTEP]
have : β i, (U i : Set Ξ²) = Set.univ := by
convert congr_arg (SetLike.coe) hU
simp
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : β (i : ΞΉ), IsOpen (s β© β(U i))
β’ β (i : ΞΉ), β(U i) = univ
[PROOFSTEP]
convert congr_arg (SetLike.coe) hU
[GOAL]
case h.e'_2
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : β (i : ΞΉ), IsOpen (s β© β(U i))
β’ β (i : ΞΉ), β(U i) = β(iSup U)
[PROOFSTEP]
simp
[GOAL]
case mpr
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : β (i : ΞΉ), IsOpen (s β© β(U i))
this : β (i : ΞΉ), β(U i) = univ
β’ IsOpen s
[PROOFSTEP]
rw [β s.inter_univ, β this, Set.inter_iUnion]
[GOAL]
case mpr
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
H : β (i : ΞΉ), IsOpen (s β© β(U i))
this : β (i : ΞΉ), β(U i) = univ
β’ IsOpen (β (i : ΞΉ), s β© β(U i))
[PROOFSTEP]
exact isOpen_iUnion H
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
β’ IsOpen s β β (i : ΞΉ), IsOpen (Subtype.val β»ΒΉ' s)
[PROOFSTEP]
rw [isOpen_iff_inter_of_iSup_eq_top hU s]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
β’ (β (i : ΞΉ), IsOpen (s β© β(U i))) β β (i : ΞΉ), IsOpen (Subtype.val β»ΒΉ' s)
[PROOFSTEP]
refine forall_congr' fun i => ?_
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
i : ΞΉ
β’ IsOpen (s β© β(U i)) β IsOpen (Subtype.val β»ΒΉ' s)
[PROOFSTEP]
rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
i : ΞΉ
β’ IsOpen (s β© β(U i)) β IsOpen (Subtype.val '' (Subtype.val β»ΒΉ' s))
[PROOFSTEP]
erw [Set.image_preimage_eq_inter_range]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
i : ΞΉ
β’ IsOpen (s β© β(U i)) β IsOpen (s β© range Subtype.val)
[PROOFSTEP]
rw [Subtype.range_coe, Opens.carrier_eq_coe]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
s : Set Ξ²
β’ IsClosed s β β (i : ΞΉ), IsClosed (Subtype.val β»ΒΉ' s)
[PROOFSTEP]
simpa using isOpen_iff_coe_preimage_of_iSup_eq_top hU sαΆ
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
β’ IsClosedMap f β β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
[PROOFSTEP]
refine' β¨fun h i => Set.restrictPreimage_isClosedMap _ h, _β©
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
β’ (β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)) β IsClosedMap f
[PROOFSTEP]
rintro H s hs
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
β’ IsClosed (f '' s)
[PROOFSTEP]
rw [isClosed_iff_coe_preimage_of_iSup_eq_top hU]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
β’ β (i : ΞΉ), IsClosed (Subtype.val β»ΒΉ' (f '' s))
[PROOFSTEP]
intro i
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
i : ΞΉ
β’ IsClosed (Subtype.val β»ΒΉ' (f '' s))
[PROOFSTEP]
convert H i _ β¨β¨_, hs.1, eq_compl_comm.mpr rflβ©β©
[GOAL]
case h.e'_3.h
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
i : ΞΉ
e_1β : { x // x β U i } = β(U i).carrier
β’ Subtype.val β»ΒΉ' (f '' s) = restrictPreimage (U i).carrier f '' (Subtype.val β»ΒΉ' sαΆ)αΆ
[PROOFSTEP]
ext β¨x, hxβ©
[GOAL]
case h.e'_3.h.h.mk
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
i : ΞΉ
e_1β : { x // x β U i } = β(U i).carrier
x : Ξ²
hx : x β U i
β’ { val := x, property := hx } β Subtype.val β»ΒΉ' (f '' s) β
{ val := x, property := hx } β restrictPreimage (U i).carrier f '' (Subtype.val β»ΒΉ' sαΆ)αΆ
[PROOFSTEP]
suffices (β y, y β s β§ f y = x) β β y, y β s β§ f y β U i β§ f y = x by simpa [Set.restrictPreimage, β Subtype.coe_inj]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
i : ΞΉ
e_1β : { x // x β U i } = β(U i).carrier
x : Ξ²
hx : x β U i
this : (β y, y β s β§ f y = x) β β y, y β s β§ f y β U i β§ f y = x
β’ { val := x, property := hx } β Subtype.val β»ΒΉ' (f '' s) β
{ val := x, property := hx } β restrictPreimage (U i).carrier f '' (Subtype.val β»ΒΉ' sαΆ)αΆ
[PROOFSTEP]
simpa [Set.restrictPreimage, β Subtype.coe_inj]
[GOAL]
case h.e'_3.h.h.mk
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
sβ : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
H : β (i : ΞΉ), IsClosedMap (restrictPreimage (U i).carrier f)
s : Set Ξ±
hs : IsClosed s
i : ΞΉ
e_1β : { x // x β U i } = β(U i).carrier
x : Ξ²
hx : x β U i
β’ (β y, y β s β§ f y = x) β β y, y β s β§ f y β U i β§ f y = x
[PROOFSTEP]
exact β¨fun β¨a, b, cβ© => β¨a, b, c.symm βΈ hx, cβ©, fun β¨a, b, _, cβ© => β¨a, b, cβ©β©
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Inducing f β β (i : ΞΉ), Inducing (restrictPreimage (U i).carrier f)
[PROOFSTEP]
simp_rw [inducing_subtype_val.inducing_iff, inducing_iff_nhds, restrictPreimage, MapsTo.coe_restrict, restrict_eq, β
@Filter.comap_comap _ _ _ _ _ f]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ (β (a : Ξ±), π a = comap f (π (f a))) β
β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
[PROOFSTEP]
constructor
[GOAL]
case mp
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ (β (a : Ξ±), π a = comap f (π (f a))) β
β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
[PROOFSTEP]
intro H i x
[GOAL]
case mp
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (a : Ξ±), π a = comap f (π (f a))
i : ΞΉ
x : β(f β»ΒΉ' (U i).carrier)
β’ π x = comap Subtype.val (comap f (π ((f β Subtype.val) x)))
[PROOFSTEP]
rw [Function.comp_apply, β H, β inducing_subtype_val.nhds_eq_comap]
[GOAL]
case mpr
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ (β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))) β
β (a : Ξ±), π a = comap f (π (f a))
[PROOFSTEP]
intro H x
[GOAL]
case mpr
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
x : Ξ±
β’ π x = comap f (π (f x))
[PROOFSTEP]
obtain β¨i, hiβ© :=
Opens.mem_iSup.mp
(show f x β iSup U by
rw [hU]
triv)
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
x : Ξ±
β’ f x β iSup U
[PROOFSTEP]
rw [hU]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
x : Ξ±
β’ f x β β€
[PROOFSTEP]
triv
[GOAL]
case mpr.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
x : Ξ±
i : ΞΉ
hi : f x β U i
β’ π x = comap f (π (f x))
[PROOFSTEP]
erw [β OpenEmbedding.map_nhds_eq (h.1 _ (U i).2).openEmbedding_subtype_val β¨x, hiβ©]
[GOAL]
case mpr.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
x : Ξ±
i : ΞΉ
hi : f x β U i
β’ map Subtype.val (π { val := x, property := hi }) = comap f (π (f x))
[PROOFSTEP]
rw [(H i) β¨x, hiβ©, Filter.subtype_coe_map_comap, Function.comp_apply, Subtype.coe_mk, inf_eq_left,
Filter.le_principal_iff]
[GOAL]
case mpr.intro
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
H : β (i : ΞΉ) (a : β(f β»ΒΉ' (U i).carrier)), π a = comap Subtype.val (comap f (π ((f β Subtype.val) a)))
x : Ξ±
i : ΞΉ
hi : f x β U i
β’ f β»ΒΉ' (U i).carrier β comap f (π (f x))
[PROOFSTEP]
exact Filter.preimage_mem_comap ((U i).2.mem_nhds hi)
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β β (i : ΞΉ), Embedding (restrictPreimage (U i).carrier f)
[PROOFSTEP]
simp_rw [embedding_iff]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Inducing f β§ Function.Injective f β
β (i : ΞΉ), Inducing (restrictPreimage (U i).carrier f) β§ Function.Injective (restrictPreimage (U i).carrier f)
[PROOFSTEP]
rw [forall_and]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Inducing f β§ Function.Injective f β
(β (x : ΞΉ), Inducing (restrictPreimage (U x).carrier f)) β§
β (x : ΞΉ), Function.Injective (restrictPreimage (U x).carrier f)
[PROOFSTEP]
apply and_congr
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Inducing f β β (x : ΞΉ), Inducing (restrictPreimage (U x).carrier f)
[PROOFSTEP]
apply inducing_iff_inducing_of_iSup_eq_top
[GOAL]
case hβ.hU
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ β¨ (i : ΞΉ), U i = β€
[PROOFSTEP]
assumption
[GOAL]
case hβ.h
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Continuous f
[PROOFSTEP]
assumption
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Function.Injective f β β (x : ΞΉ), Function.Injective (restrictPreimage (U x).carrier f)
[PROOFSTEP]
apply Set.injective_iff_injective_of_iUnion_eq_univ
[GOAL]
case hβ.hU
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ β (i : ΞΉ), (U i).carrier = univ
[PROOFSTEP]
convert congr_arg SetLike.coe hU
[GOAL]
case h.e'_2
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ β (i : ΞΉ), (U i).carrier = β(iSup U)
[PROOFSTEP]
simp
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ OpenEmbedding f β β (i : ΞΉ), OpenEmbedding (restrictPreimage (U i).carrier f)
[PROOFSTEP]
simp_rw [openEmbedding_iff]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β§ IsOpen (range f) β
β (i : ΞΉ), Embedding (restrictPreimage (U i).carrier f) β§ IsOpen (range (restrictPreimage (U i).carrier f))
[PROOFSTEP]
rw [forall_and]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β§ IsOpen (range f) β
(β (x : ΞΉ), Embedding (restrictPreimage (U x).carrier f)) β§
β (x : ΞΉ), IsOpen (range (restrictPreimage (U x).carrier f))
[PROOFSTEP]
apply and_congr
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β β (x : ΞΉ), Embedding (restrictPreimage (U x).carrier f)
[PROOFSTEP]
apply embedding_iff_embedding_of_iSup_eq_top
[GOAL]
case hβ.hU
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ β¨ (i : ΞΉ), U i = β€
[PROOFSTEP]
assumption
[GOAL]
case hβ.h
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Continuous f
[PROOFSTEP]
assumption
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ IsOpen (range f) β β (x : ΞΉ), IsOpen (range (restrictPreimage (U x).carrier f))
[PROOFSTEP]
simp_rw [Set.range_restrictPreimage]
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ IsOpen (range f) β β (x : ΞΉ), IsOpen (Subtype.val β»ΒΉ' range f)
[PROOFSTEP]
apply isOpen_iff_coe_preimage_of_iSup_eq_top hU
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ ClosedEmbedding f β β (i : ΞΉ), ClosedEmbedding (restrictPreimage (U i).carrier f)
[PROOFSTEP]
simp_rw [closedEmbedding_iff]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β§ IsClosed (range f) β
β (i : ΞΉ), Embedding (restrictPreimage (U i).carrier f) β§ IsClosed (range (restrictPreimage (U i).carrier f))
[PROOFSTEP]
rw [forall_and]
[GOAL]
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β§ IsClosed (range f) β
(β (x : ΞΉ), Embedding (restrictPreimage (U x).carrier f)) β§
β (x : ΞΉ), IsClosed (range (restrictPreimage (U x).carrier f))
[PROOFSTEP]
apply and_congr
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Embedding f β β (x : ΞΉ), Embedding (restrictPreimage (U x).carrier f)
[PROOFSTEP]
apply embedding_iff_embedding_of_iSup_eq_top
[GOAL]
case hβ.hU
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ β¨ (i : ΞΉ), U i = β€
[PROOFSTEP]
assumption
[GOAL]
case hβ.h
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ Continuous f
[PROOFSTEP]
assumption
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ IsClosed (range f) β β (x : ΞΉ), IsClosed (range (restrictPreimage (U x).carrier f))
[PROOFSTEP]
simp_rw [Set.range_restrictPreimage]
[GOAL]
case hβ
Ξ± : Type u_1
Ξ² : Type u_2
instβΒΉ : TopologicalSpace Ξ±
instβ : TopologicalSpace Ξ²
f : Ξ± β Ξ²
s : Set Ξ²
ΞΉ : Type u_3
U : ΞΉ β Opens Ξ²
hU : iSup U = β€
h : Continuous f
β’ IsClosed (range f) β β (x : ΞΉ), IsClosed (Subtype.val β»ΒΉ' range f)
[PROOFSTEP]
apply isClosed_iff_coe_preimage_of_iSup_eq_top hU
|
/-
Copyright (c) 2022 MarΓa InΓ©s de Frutos-FernΓ‘ndez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: MarΓa InΓ©s de Frutos-FernΓ‘ndez
! This file was ported from Lean 3 source module ring_theory.dedekind_domain.adic_valuation
! leanprover-community/mathlib commit a8e7ac804fc39df0340c64906075787e0c90fa60
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.RingTheory.DedekindDomain.Ideal
import Mathbin.RingTheory.Valuation.ExtendToLocalization
import Mathbin.RingTheory.Valuation.ValuationSubring
import Mathbin.RingTheory.Polynomial.Cyclotomic.Basic
import Mathbin.Topology.Algebra.ValuedField
/-!
# Adic valuations on Dedekind domains
Given a Dedekind domain `R` of Krull dimension 1 and a maximal ideal `v` of `R`, we define the
`v`-adic valuation on `R` and its extension to the field of fractions `K` of `R`.
We prove several properties of this valuation, including the existence of uniformizers.
We define the completion of `K` with respect to the `v`-adic valuation, denoted
`v.adic_completion`,and its ring of integers, denoted `v.adic_completion_integers`.
## Main definitions
- `is_dedekind_domain.height_one_spectrum.int_valuation v` is the `v`-adic valuation on `R`.
- `is_dedekind_domain.height_one_spectrum.valuation v` is the `v`-adic valuation on `K`.
- `is_dedekind_domain.height_one_spectrum.adic_completion v` is the completion of `K` with respect
to its `v`-adic valuation.
- `is_dedekind_domain.height_one_spectrum.adic_completion_integers v` is the ring of integers of
`v.adic_completion`.
## Main results
- `is_dedekind_domain.height_one_spectrum.int_valuation_le_one` : The `v`-adic valuation on `R` is
bounded above by 1.
- `is_dedekind_domain.height_one_spectrum.int_valuation_lt_one_iff_dvd` : The `v`-adic valuation of
`r β R` is less than 1 if and only if `v` divides the ideal `(r)`.
- `is_dedekind_domain.height_one_spectrum.int_valuation_le_pow_iff_dvd` : The `v`-adic valuation of
`r β R` is less than or equal to `multiplicative.of_add (-n)` if and only if `vβΏ` divides the
ideal `(r)`.
- `is_dedekind_domain.height_one_spectrum.int_valuation_exists_uniformizer` : There exists `Ο β R`
with `v`-adic valuation `multiplicative.of_add (-1)`.
- `is_dedekind_domain.height_one_spectrum.valuation_of_mk'` : The `v`-adic valuation of `r/s β K`
is the valuation of `r` divided by the valuation of `s`.
- `is_dedekind_domain.height_one_spectrum.valuation_of_algebra_map` : The `v`-adic valuation on `K`
extends the `v`-adic valuation on `R`.
- `is_dedekind_domain.height_one_spectrum.valuation_exists_uniformizer` : There exists `Ο β K` with
`v`-adic valuation `multiplicative.of_add (-1)`.
## Implementation notes
We are only interested in Dedekind domains with Krull dimension 1.
## References
* [G. J. Janusz, *Algebraic Number Fields*][janusz1996]
* [J.W.S. Cassels, A. FrΓΆlich, *Algebraic Number Theory*][cassels1967algebraic]
* [J. Neukirch, *Algebraic Number Theory*][Neukirch1992]
## Tags
dedekind domain, dedekind ring, adic valuation
-/
noncomputable section
open Classical DiscreteValuation
open Multiplicative IsDedekindDomain
variable {R : Type _} [CommRing R] [IsDomain R] [IsDedekindDomain R] {K : Type _} [Field K]
[Algebra R K] [IsFractionRing R K] (v : HeightOneSpectrum R)
namespace IsDedekindDomain.HeightOneSpectrum
/-! ### Adic valuations on the Dedekind domain R -/
/-- The additive `v`-adic valuation of `r β R` is the exponent of `v` in the factorization of the
ideal `(r)`, if `r` is nonzero, or infinity, if `r = 0`. `int_valuation_def` is the corresponding
multiplicative valuation. -/
def intValuationDef (r : R) : β€ββ :=
if r = 0 then 0
else
Multiplicative.ofAdd
(-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : β€)
#align is_dedekind_domain.height_one_spectrum.int_valuation_def IsDedekindDomain.HeightOneSpectrum.intValuationDef
theorem intValuationDef_if_pos {r : R} (hr : r = 0) : v.intValuationDef r = 0 :=
if_pos hr
#align is_dedekind_domain.height_one_spectrum.int_valuation_def_if_pos IsDedekindDomain.HeightOneSpectrum.intValuationDef_if_pos
theorem intValuationDef_if_neg {r : R} (hr : r β 0) :
v.intValuationDef r =
Multiplicative.ofAdd
(-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : β€) :=
if_neg hr
#align is_dedekind_domain.height_one_spectrum.int_valuation_def_if_neg IsDedekindDomain.HeightOneSpectrum.intValuationDef_if_neg
/-- Nonzero elements have nonzero adic valuation. -/
theorem int_valuation_ne_zero (x : R) (hx : x β 0) : v.intValuationDef x β 0 :=
by
rw [int_valuation_def, if_neg hx]
exact WithZero.coe_ne_zero
#align is_dedekind_domain.height_one_spectrum.int_valuation_ne_zero IsDedekindDomain.HeightOneSpectrum.int_valuation_ne_zero
/-- Nonzero divisors have nonzero valuation. -/
theorem int_valuation_ne_zero' (x : nonZeroDivisors R) : v.intValuationDef x β 0 :=
v.int_valuation_ne_zero x (nonZeroDivisors.coe_ne_zero x)
#align is_dedekind_domain.height_one_spectrum.int_valuation_ne_zero' IsDedekindDomain.HeightOneSpectrum.int_valuation_ne_zero'
/-- Nonzero divisors have valuation greater than zero. -/
theorem int_valuation_zero_le (x : nonZeroDivisors R) : 0 < v.intValuationDef x :=
by
rw [v.int_valuation_def_if_neg (nonZeroDivisors.coe_ne_zero x)]
exact WithZero.zero_lt_coe _
#align is_dedekind_domain.height_one_spectrum.int_valuation_zero_le IsDedekindDomain.HeightOneSpectrum.int_valuation_zero_le
/-- The `v`-adic valuation on `R` is bounded above by 1. -/
theorem int_valuation_le_one (x : R) : v.intValuationDef x β€ 1 :=
by
rw [int_valuation_def]
by_cases hx : x = 0
Β· rw [if_pos hx]
exact WithZero.zero_le 1
Β· rw [if_neg hx, β WithZero.coe_one, β ofAdd_zero, WithZero.coe_le_coe, of_add_le,
Right.neg_nonpos_iff]
exact Int.coe_nat_nonneg _
#align is_dedekind_domain.height_one_spectrum.int_valuation_le_one IsDedekindDomain.HeightOneSpectrum.int_valuation_le_one
/-- The `v`-adic valuation of `r β R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
theorem int_valuation_lt_one_iff_dvd (r : R) :
v.intValuationDef r < 1 β v.asIdeal β£ Ideal.span {r} :=
by
rw [int_valuation_def]
split_ifs with hr
Β· simpa [hr] using WithZero.zero_lt_coe _
Β· rw [β WithZero.coe_one, β ofAdd_zero, WithZero.coe_lt_coe, of_add_lt, neg_lt_zero, β
Int.ofNat_zero, Int.ofNat_lt, zero_lt_iff]
have h : (Ideal.span {r} : Ideal R) β 0 :=
by
rw [Ne.def, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
exact hr
apply Associates.count_ne_zero_iff_dvd h (by apply v.irreducible)
#align is_dedekind_domain.height_one_spectrum.int_valuation_lt_one_iff_dvd IsDedekindDomain.HeightOneSpectrum.int_valuation_lt_one_iff_dvd
/-- The `v`-adic valuation of `r β R` is less than `multiplicative.of_add (-n)` if and only if
`vβΏ` divides the ideal `(r)`. -/
theorem int_valuation_le_pow_iff_dvd (r : R) (n : β) :
v.intValuationDef r β€ Multiplicative.ofAdd (-(n : β€)) β v.asIdeal ^ n β£ Ideal.span {r} :=
by
rw [int_valuation_def]
split_ifs with hr
Β· simp_rw [hr, Ideal.dvd_span_singleton, zero_le', Submodule.zero_mem]
Β·
rw [WithZero.coe_le_coe, of_add_le, neg_le_neg_iff, Int.ofNat_le, Ideal.dvd_span_singleton, β
Associates.le_singleton_iff,
Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hr)
(by apply v.associates_irreducible)]
#align is_dedekind_domain.height_one_spectrum.int_valuation_le_pow_iff_dvd IsDedekindDomain.HeightOneSpectrum.int_valuation_le_pow_iff_dvd
/-- The `v`-adic valuation of `0 : R` equals 0. -/
theorem IntValuation.map_zero' : v.intValuationDef 0 = 0 :=
v.intValuationDef_if_pos (Eq.refl 0)
#align is_dedekind_domain.height_one_spectrum.int_valuation.map_zero' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_zero'
/-- The `v`-adic valuation of `1 : R` equals 1. -/
theorem IntValuation.map_one' : v.intValuationDef 1 = 1 := by
rw [v.int_valuation_def_if_neg (zero_ne_one.symm : (1 : R) β 0), Ideal.span_singleton_one, β
Ideal.one_eq_top, Associates.mk_one, Associates.factors_one,
Associates.count_zero (by apply v.associates_irreducible), Int.ofNat_zero, neg_zero, ofAdd_zero,
WithZero.coe_one]
#align is_dedekind_domain.height_one_spectrum.int_valuation.map_one' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_one'
/-- The `v`-adic valuation of a product equals the product of the valuations. -/
theorem IntValuation.map_mul' (x y : R) :
v.intValuationDef (x * y) = v.intValuationDef x * v.intValuationDef y :=
by
simp only [int_valuation_def]
by_cases hx : x = 0
Β· rw [hx, MulZeroClass.zero_mul, if_pos (Eq.refl _), MulZeroClass.zero_mul]
Β· by_cases hy : y = 0
Β· rw [hy, MulZeroClass.mul_zero, if_pos (Eq.refl _), MulZeroClass.mul_zero]
Β· rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), β WithZero.coe_mul, WithZero.coe_inj, β
ofAdd_add, β Ideal.span_singleton_mul_span_singleton, β Associates.mk_mul_mk, β neg_add,
Associates.count_mul (by apply associates.mk_ne_zero'.mpr hx)
(by apply associates.mk_ne_zero'.mpr hy) (by apply v.associates_irreducible)]
rfl
#align is_dedekind_domain.height_one_spectrum.int_valuation.map_mul' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_mul'
theorem IntValuation.le_max_iff_min_le {a b c : β} :
Multiplicative.ofAdd (-c : β€) β€
max (Multiplicative.ofAdd (-a : β€)) (Multiplicative.ofAdd (-b : β€)) β
min a b β€ c :=
by
rw [le_max_iff, of_add_le, of_add_le, neg_le_neg_iff, neg_le_neg_iff, Int.ofNat_le, Int.ofNat_le,
β min_le_iff]
#align is_dedekind_domain.height_one_spectrum.int_valuation.le_max_iff_min_le IsDedekindDomain.HeightOneSpectrum.IntValuation.le_max_iff_min_le
/-- The `v`-adic valuation of a sum is bounded above by the maximum of the valuations. -/
theorem IntValuation.map_add_le_max' (x y : R) :
v.intValuationDef (x + y) β€ max (v.intValuationDef x) (v.intValuationDef y) :=
by
by_cases hx : x = 0
Β· rw [hx, zero_add]
conv_rhs => rw [int_valuation_def, if_pos (Eq.refl _)]
rw [max_eq_right (WithZero.zero_le (v.int_valuation_def y))]
exact le_refl _
Β· by_cases hy : y = 0
Β· rw [hy, add_zero]
conv_rhs => rw [max_comm, int_valuation_def, if_pos (Eq.refl _)]
rw [max_eq_right (WithZero.zero_le (v.int_valuation_def x))]
exact le_refl _
Β· by_cases hxy : x + y = 0
Β· rw [int_valuation_def, if_pos hxy]
exact zero_le'
Β· rw [v.int_valuation_def_if_neg hxy, v.int_valuation_def_if_neg hx,
v.int_valuation_def_if_neg hy, [anonymous], int_valuation.le_max_iff_min_le]
set nmin :=
min ((Associates.mk v.as_ideal).count (Associates.mk (Ideal.span {x})).factors)
((Associates.mk v.as_ideal).count (Associates.mk (Ideal.span {y})).factors)
have h_dvd_x : x β v.as_ideal ^ nmin :=
by
rw [β Associates.le_singleton_iff x nmin _,
Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hx) _]
exact min_le_left _ _
apply v.associates_irreducible
have h_dvd_y : y β v.as_ideal ^ nmin :=
by
rw [β Associates.le_singleton_iff y nmin _,
Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hy) _]
exact min_le_right _ _
apply v.associates_irreducible
have h_dvd_xy : Associates.mk v.as_ideal ^ nmin β€ Associates.mk (Ideal.span {x + y}) :=
by
rw [Associates.le_singleton_iff]
exact Ideal.add_mem (v.as_ideal ^ nmin) h_dvd_x h_dvd_y
rw [Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hxy) _] at h_dvd_xy
exact h_dvd_xy
apply v.associates_irreducible
#align is_dedekind_domain.height_one_spectrum.int_valuation.map_add_le_max' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_add_le_max'
/-- The `v`-adic valuation on `R`. -/
def intValuation : Valuation R β€ββ
where
toFun := v.intValuationDef
map_zero' := IntValuation.map_zero' v
map_one' := IntValuation.map_one' v
map_mul' := IntValuation.map_mul' v
map_add_le_max' := IntValuation.map_add_le_max' v
#align is_dedekind_domain.height_one_spectrum.int_valuation IsDedekindDomain.HeightOneSpectrum.intValuation
/-- There exists `Ο β R` with `v`-adic valuation `multiplicative.of_add (-1)`. -/
theorem int_valuation_exists_uniformizer :
β Ο : R, v.intValuationDef Ο = Multiplicative.ofAdd (-1 : β€) :=
by
have hv : _root_.irreducible (Associates.mk v.as_ideal) := v.associates_irreducible
have hlt : v.as_ideal ^ 2 < v.as_ideal :=
by
rw [β Ideal.dvdNotUnit_iff_lt]
exact
β¨v.ne_bot, v.as_ideal, (not_congr Ideal.isUnit_iff).mpr (Ideal.IsPrime.ne_top v.is_prime),
sq v.as_idealβ©
obtain β¨Ο, mem, nmemβ© := SetLike.exists_of_lt hlt
have hΟ : Associates.mk (Ideal.span {Ο}) β 0 :=
by
rw [Associates.mk_ne_zero']
intro h
rw [h] at nmem
exact nmem (Submodule.zero_mem (v.as_ideal ^ 2))
use Ο
rw [int_valuation_def, if_neg (associates.mk_ne_zero'.mp hΟ), WithZero.coe_inj]
apply congr_arg
rw [neg_inj, β Int.ofNat_one, Int.coe_nat_inj']
rw [β Ideal.dvd_span_singleton, β Associates.mk_le_mk_iff_dvd_iff] at mem nmem
rw [β pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hΟ hv] at mem
rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hΟ hv, not_le] at nmem
exact Nat.eq_of_le_of_lt_succ mem nmem
#align is_dedekind_domain.height_one_spectrum.int_valuation_exists_uniformizer IsDedekindDomain.HeightOneSpectrum.int_valuation_exists_uniformizer
/-! ### Adic valuations on the field of fractions `K` -/
/-- The `v`-adic valuation of `x β K` is the valuation of `r` divided by the valuation of `s`,
where `r` and `s` are chosen so that `x = r/s`. -/
def valuation (v : HeightOneSpectrum R) : Valuation K β€ββ :=
v.intValuation.extendToLocalization
(fun r hr => Set.mem_compl <| v.int_valuation_ne_zero' β¨r, hrβ©) K
#align is_dedekind_domain.height_one_spectrum.valuation IsDedekindDomain.HeightOneSpectrum.valuation
theorem valuation_def (x : K) :
v.Valuation x =
v.intValuation.extendToLocalization
(fun r hr => Set.mem_compl (v.int_valuation_ne_zero' β¨r, hrβ©)) K x :=
rfl
#align is_dedekind_domain.height_one_spectrum.valuation_def IsDedekindDomain.HeightOneSpectrum.valuation_def
/-- The `v`-adic valuation of `r/s β K` is the valuation of `r` divided by the valuation of `s`. -/
theorem valuation_of_mk' {r : R} {s : nonZeroDivisors R} :
v.Valuation (IsLocalization.mk' K r s) = v.intValuation r / v.intValuation s :=
by
erw [valuation_def, (IsLocalization.toLocalizationMap (nonZeroDivisors R) K).lift_mk',
div_eq_mul_inv, mul_eq_mul_left_iff]
left
rw [Units.val_inv_eq_inv_val, inv_inj]
rfl
#align is_dedekind_domain.height_one_spectrum.valuation_of_mk' IsDedekindDomain.HeightOneSpectrum.valuation_of_mk'
/-- The `v`-adic valuation on `K` extends the `v`-adic valuation on `R`. -/
theorem valuation_of_algebraMap (r : R) : v.Valuation (algebraMap R K r) = v.intValuation r := by
rw [valuation_def, Valuation.extendToLocalization_apply_map_apply]
#align is_dedekind_domain.height_one_spectrum.valuation_of_algebra_map IsDedekindDomain.HeightOneSpectrum.valuation_of_algebraMap
/-- The `v`-adic valuation on `R` is bounded above by 1. -/
theorem valuation_le_one (r : R) : v.Valuation (algebraMap R K r) β€ 1 :=
by
rw [valuation_of_algebra_map]
exact v.int_valuation_le_one r
#align is_dedekind_domain.height_one_spectrum.valuation_le_one IsDedekindDomain.HeightOneSpectrum.valuation_le_one
/-- The `v`-adic valuation of `r β R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
theorem valuation_lt_one_iff_dvd (r : R) :
v.Valuation (algebraMap R K r) < 1 β v.asIdeal β£ Ideal.span {r} :=
by
rw [valuation_of_algebra_map]
exact v.int_valuation_lt_one_iff_dvd r
#align is_dedekind_domain.height_one_spectrum.valuation_lt_one_iff_dvd IsDedekindDomain.HeightOneSpectrum.valuation_lt_one_iff_dvd
variable (K)
/-- There exists `Ο β K` with `v`-adic valuation `multiplicative.of_add (-1)`. -/
theorem valuation_exists_uniformizer : β Ο : K, v.Valuation Ο = Multiplicative.ofAdd (-1 : β€) :=
by
obtain β¨r, hrβ© := v.int_valuation_exists_uniformizer
use algebraMap R K r
rw [valuation_def, Valuation.extendToLocalization_apply_map_apply]
exact hr
#align is_dedekind_domain.height_one_spectrum.valuation_exists_uniformizer IsDedekindDomain.HeightOneSpectrum.valuation_exists_uniformizer
/-- Uniformizers are nonzero. -/
theorem valuation_uniformizer_ne_zero : Classical.choose (v.valuation_exists_uniformizer K) β 0 :=
haveI hu := Classical.choose_spec (v.valuation_exists_uniformizer K)
(Valuation.ne_zero_iff _).mp (ne_of_eq_of_ne hu WithZero.coe_ne_zero)
#align is_dedekind_domain.height_one_spectrum.valuation_uniformizer_ne_zero IsDedekindDomain.HeightOneSpectrum.valuation_uniformizer_ne_zero
/-! ### Completions with respect to adic valuations
Given a Dedekind domain `R` with field of fractions `K` and a maximal ideal `v` of `R`, we define
the completion of `K` with respect to its `v`-adic valuation, denoted `v.adic_completion`, and its
ring of integers, denoted `v.adic_completion_integers`. -/
variable {K}
/-- `K` as a valued field with the `v`-adic valuation. -/
def adicValued : Valued K β€ββ :=
Valued.mk' v.Valuation
#align is_dedekind_domain.height_one_spectrum.adic_valued IsDedekindDomain.HeightOneSpectrum.adicValued
theorem adicValued_apply {x : K} : (v.adicValued.V : _) x = v.Valuation x :=
rfl
#align is_dedekind_domain.height_one_spectrum.adic_valued_apply IsDedekindDomain.HeightOneSpectrum.adicValued_apply
variable (K)
/-- The completion of `K` with respect to its `v`-adic valuation. -/
def AdicCompletion :=
@UniformSpace.Completion K v.adicValued.toUniformSpace
#align is_dedekind_domain.height_one_spectrum.adic_completion IsDedekindDomain.HeightOneSpectrum.AdicCompletion
instance : Field (v.adicCompletion K) :=
@UniformSpace.Completion.field K _ v.adicValued.toUniformSpace _ _ v.adicValued.to_uniformAddGroup
instance : Inhabited (v.adicCompletion K) :=
β¨0β©
instance valuedAdicCompletion : Valued (v.adicCompletion K) β€ββ :=
@Valued.valuedCompletion _ _ _ _ v.adicValued
#align is_dedekind_domain.height_one_spectrum.valued_adic_completion IsDedekindDomain.HeightOneSpectrum.valuedAdicCompletion
theorem valuedAdicCompletion_def {x : v.adicCompletion K} :
Valued.v x = @Valued.extension K _ _ _ (adicValued v) x :=
rfl
#align is_dedekind_domain.height_one_spectrum.valued_adic_completion_def IsDedekindDomain.HeightOneSpectrum.valuedAdicCompletion_def
instance adicCompletion_completeSpace : CompleteSpace (v.adicCompletion K) :=
@UniformSpace.Completion.completeSpace K v.adicValued.toUniformSpace
#align is_dedekind_domain.height_one_spectrum.adic_completion_complete_space IsDedekindDomain.HeightOneSpectrum.adicCompletion_completeSpace
instance AdicCompletion.hasLiftT : HasLiftT K (v.adicCompletion K) :=
(inferInstance : HasLiftT K (@UniformSpace.Completion K v.adicValued.toUniformSpace))
#align is_dedekind_domain.height_one_spectrum.adic_completion.has_lift_t IsDedekindDomain.HeightOneSpectrum.AdicCompletion.hasLiftT
/-- The ring of integers of `adic_completion`. -/
def adicCompletionIntegers : ValuationSubring (v.adicCompletion K) :=
Valued.v.ValuationSubring
#align is_dedekind_domain.height_one_spectrum.adic_completion_integers IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers
instance : Inhabited (adicCompletionIntegers K v) :=
β¨0β©
variable (R K)
theorem mem_adicCompletionIntegers {x : v.adicCompletion K} :
x β v.adicCompletionIntegers K β (Valued.v x : β€ββ) β€ 1 :=
Iff.rfl
#align is_dedekind_domain.height_one_spectrum.mem_adic_completion_integers IsDedekindDomain.HeightOneSpectrum.mem_adicCompletionIntegers
section AlgebraInstances
instance (priority := 100) adicValued.has_uniform_continuous_const_smul' :
@UniformContinuousConstSMul R K v.adicValued.toUniformSpace _ :=
@uniformContinuousConstSMul_of_continuousConstSMul R K _ _ _ v.adicValued.toUniformSpace _ _
#align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul' IsDedekindDomain.HeightOneSpectrum.adicValued.has_uniform_continuous_const_smul'
instance adicValued.uniformContinuousConstSMul :
@UniformContinuousConstSMul K K v.adicValued.toUniformSpace _ :=
@Ring.uniformContinuousConstSMul K _ v.adicValued.toUniformSpace _ _
#align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul IsDedekindDomain.HeightOneSpectrum.adicValued.uniformContinuousConstSMul
instance AdicCompletion.algebra' : Algebra R (v.adicCompletion K) :=
@UniformSpace.Completion.algebra K _ v.adicValued.toUniformSpace _ _ R _ _
(adicValued.has_uniform_continuous_const_smul' R K v)
#align is_dedekind_domain.height_one_spectrum.adic_completion.algebra' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.algebra'
@[simp]
theorem coe_smul_adicCompletion (r : R) (x : K) :
(β(r β’ x) : v.adicCompletion K) = r β’ (βx : v.adicCompletion K) :=
@UniformSpace.Completion.coe_smul R K v.adicValued.toUniformSpace _ _ r x
#align is_dedekind_domain.height_one_spectrum.coe_smul_adic_completion IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletion
instance : Algebra K (v.adicCompletion K) :=
@UniformSpace.Completion.algebra' K _ v.adicValued.toUniformSpace _ _
theorem algebraMap_adic_completion' :
β(algebraMap R <| v.adicCompletion K) = coe β algebraMap R K :=
rfl
#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion'
theorem algebraMap_adicCompletion : β(algebraMap K <| v.adicCompletion K) = coe :=
rfl
#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion
instance : IsScalarTower R K (v.adicCompletion K) :=
@UniformSpace.Completion.isScalarTower R K K v.adicValued.toUniformSpace _ _ _
(adicValued.has_uniform_continuous_const_smul' R K v) _ _
instance : Algebra R (v.adicCompletionIntegers K)
where
smul r x :=
β¨r β’ (x : v.adicCompletion K),
by
have h : (algebraMap R (adicCompletion K v)) r = (coe <| algebraMap R K r) := rfl
rw [Algebra.smul_def]
refine' ValuationSubring.mul_mem _ _ _ _ x.2
rw [mem_adic_completion_integers, h, Valued.valuedCompletion_apply]
exact v.valuation_le_one _β©
toFun r :=
β¨coe <| algebraMap R K r, by
simpa only [mem_adic_completion_integers, Valued.valuedCompletion_apply] using
v.valuation_le_one _β©
map_one' := by simp only [map_one] <;> rfl
map_mul' x y := by
ext
simp_rw [RingHom.map_mul, Subring.coe_mul, Subtype.coe_mk, UniformSpace.Completion.coe_mul]
map_zero' := by simp only [map_zero] <;> rfl
map_add' x y := by
ext
simp_rw [RingHom.map_add, Subring.coe_add, Subtype.coe_mk, UniformSpace.Completion.coe_add]
commutes' r x := by rw [mul_comm]
smul_def' r x := by
ext
simp only [Subring.coe_mul, [anonymous], Algebra.smul_def]
rfl
@[simp]
theorem coe_smul_adicCompletionIntegers (r : R) (x : v.adicCompletionIntegers K) :
(β(r β’ x) : v.adicCompletion K) = r β’ (x : v.adicCompletion K) :=
rfl
#align is_dedekind_domain.height_one_spectrum.coe_smul_adic_completion_integers IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletionIntegers
instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
where eq_zero_or_eq_zero_of_smul_eq_zero c x hcx :=
by
rw [Algebra.smul_def, mul_eq_zero] at hcx
refine' hcx.imp_left fun hc => _
letI : UniformSpace K := v.adic_valued.to_uniform_space
rw [β map_zero (algebraMap R (v.adic_completion_integers K))] at hc
exact
IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (subtype.ext_iff.mp hc))
instance AdicCompletion.is_scalar_tower' :
IsScalarTower R (v.adicCompletionIntegers K) (v.adicCompletion K)
where smul_assoc x y z := by
simp only [Algebra.smul_def]
apply mul_assoc
#align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower'
end AlgebraInstances
end IsDedekindDomain.HeightOneSpectrum
|
Class Monad (m : Type -> Type) : Type := {
return_ : forall {A}, A -> m A
; bind : forall {A}, m A -> forall {B}, (A -> m B) -> m B
(* monad laws *)
; right_unit : forall A (a : m A), a = bind a (@return_ A)
; left_unit : forall A (a : A) B (f : A -> m B),
f a = bind (return_ a) f
; associativity : forall A (ma : m A) B f C (g : B -> m C),
bind ma (fun x => bind (f x) g) = bind (bind ma f) g
}.
Notation "a >>= f" := (bind a f) (at level 50, left associativity).
Notation "a >> b" := (a >>= (fun _ => b)) (at level 50, left associativity).
Notation "'do' a <- e ; c" :=
(e >>= (fun a => c)) (at level 60, right associativity).
Instance OptionMonad : Monad option := {
return_ := Some
; bind A m B f :=
match m with
| None => None
| Some a => f a
end
}.
Proof.
destruct a; reflexivity.
reflexivity.
destruct ma.
intros B f C g. destruct (f a); reflexivity.
reflexivity.
Defined. |
Le Bouchon Des Batignolles also called BB 17, a brewery located in the heart of the Batignolles district, at 2 rue Lemercier, angle with the rue des Dames, welcomes you in a friendly and festive decor.
The Boss, Marseille offers a cuisine with straight came from Corsica. Good small Mediterranean dishes that take you to the dry landscape and brings warmth.
The concept: An endless tapas menu of any kind to eat alone or with friends, perfect with a good bottle of "CuvΓ©e Castellu Vecchiu" straight from the mountains Corsica.
BUT .... The BB17 is not only a restaurant but also a wine bar where we just drink shots with friends listening to good music.
IN BB17 you can privatize part or all of the restaurant to come and celebrate your birthday or other festive event.
The BB17 or subtle blend between Corsica and Marseille. The sun, the accent singing and good humor. |
lemma continuous_on_closed_Union: assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> closed (U i)" "\<And>i. i \<in> I \<Longrightarrow> continuous_on (U i) f" shows "continuous_on (\<Union> i \<in> I. U i) f" |
module Main where
import Mandelbrot
import Data.Complex (Complex((:+)))
import Graphics.UI.SDL.Video
import Graphics.UI.SDL.Event (quitRequested)
import Graphics.UI.SDL.Types (Surface(surfacePixels))
import Foreign.C.String (newCString)
import Foreign.C.Types (CInt(..))
import Foreign.Ptr
import Foreign.Storable
import Data.Int (Int32(..), Int64(..))
import Data.Word
import Control.Monad
import Control.Concurrent (threadDelay)
import Data.Array
import Data.Array.MArray
import Data.Array.IO
import Data.IORef
import System.Random
import System.IO.Unsafe
sdlWindowPosCentered :: CInt
sdlWindowPosCentered = 0x2fff0000
iterations :: Int
iterations = 100
width :: Int
width = 1024
height :: Int
height = 786
widthF :: Double
widthF = fromIntegral width
heightF :: Double
heightF = fromIntegral height
mandelbrotI :: RealFloat a => Complex a -> Int
mandelbrotI = mandelbrot iterations
{-# INLINE mandelbrotI #-}
while :: Monad m => m Bool -> m a -> m ()
while test action = do
val <- test
if val
then action >> while test action
else return ()
main :: IO ()
main = do
videoInit nullPtr
title <- (newCString "Handelbrot")
palette <- array (1, iterations) <$> sequence ( [sequence (i, (fromIntegral <$> randomRIO (0 :: Word, 0xffffff)) :: IO Word32) | i <- [1..iterations-1]] ++ [return (iterations, 0)] )
window <- createWindow title sdlWindowPosCentered sdlWindowPosCentered (CInt $ fromIntegral width) (CInt $ fromIntegral height) 0
surface <- getWindowSurface window
lockSurface surface
pixels <- liftM (castPtr.surfacePixels) $ peek surface :: IO (Ptr Word32)
forM_ [0..height-1] (\y_ -> do
forM_ [0..width-1] (\x_ -> do
let x = 3/widthF * (fromIntegral x_) - 2
y = -2/heightF * (fromIntegral y_) + 1
mand = mandelbrotI (x :+ y)
pokeElemOff pixels (x_ + y_*width) $ palette ! mand)
updateWindowSurface window)
unlockSurface surface
updateWindowSurface window
while (liftM not $ quitRequested) $ threadDelay 100000
|
/-
Copyright (c) 2018 Andreas Swerdlow. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Andreas Swerdlow
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.deprecated.subring
import Mathlib.algebra.group_with_zero.power
import Mathlib.PostPort
universes u_1 l u_2
namespace Mathlib
class is_subfield {F : Type u_1} [field F] (S : set F) extends is_subring S where
inv_mem : β {x : F}, x β S β xβ»ΒΉ β S
protected instance is_subfield.field {F : Type u_1} [field F] (S : set F) [is_subfield S] :
field β₯S :=
let cr_inst : comm_ring β₯S := subset.comm_ring;
field.mk comm_ring.add sorry comm_ring.zero sorry sorry comm_ring.neg comm_ring.sub sorry sorry
comm_ring.mul sorry comm_ring.one sorry sorry sorry sorry sorry
(fun (x : β₯S) => { val := βxβ»ΒΉ, property := sorry }) sorry sorry sorry
theorem is_subfield.pow_mem {F : Type u_1} [field F] {a : F} {n : β€} {s : set F} [is_subfield s]
(h : a β s) : a ^ n β s :=
int.cases_on n (fun (n : β) => is_submonoid.pow_mem h)
fun (n : β) => is_subfield.inv_mem (is_submonoid.pow_mem h)
protected instance univ.is_subfield {F : Type u_1} [field F] : is_subfield set.univ :=
is_subfield.mk fun (x : F) (αΎ° : x β set.univ) => trivial
/- note: in the next two declarations, if we let type-class inference figure out the instance
`ring_hom.is_subring_preimage` then that instance only applies when particular instances of
`is_add_subgroup _` and `is_submonoid _` are chosen (which are not the default ones).
If we specify it explicitly, then it doesn't complain. -/
protected instance preimage.is_subfield {F : Type u_1} [field F] {K : Type u_2} [field K]
(f : F β+* K) (s : set K) [is_subfield s] : is_subfield (βf β»ΒΉ' s) :=
is_subfield.mk
fun (a : F) (ha : coe_fn f a β s) =>
(fun (this : coe_fn f (aβ»ΒΉ) β s) => this)
(eq.mpr (id (Eq._oldrec (Eq.refl (coe_fn f (aβ»ΒΉ) β s)) (ring_hom.map_inv f a)))
(is_subfield.inv_mem ha))
protected instance image.is_subfield {F : Type u_1} [field F] {K : Type u_2} [field K] (f : F β+* K)
(s : set F) [is_subfield s] : is_subfield (βf '' s) :=
is_subfield.mk fun (a : K) (_x : a β βf '' s) => sorry
protected instance range.is_subfield {F : Type u_1} [field F] {K : Type u_2} [field K]
(f : F β+* K) : is_subfield (set.range βf) :=
eq.mpr (id (Eq._oldrec (Eq.refl (is_subfield (set.range βf))) (Eq.symm set.image_univ)))
(image.is_subfield f set.univ)
namespace field
/-- `field.closure s` is the minimal subfield that includes `s`. -/
def closure {F : Type u_1} [field F] (S : set F) : set F :=
set_of
fun (x : F) =>
β (y : F), β (H : y β ring.closure S), β (z : F), β (H : z β ring.closure S), y / z = x
theorem ring_closure_subset {F : Type u_1} [field F] {S : set F} : ring.closure S β closure S :=
fun (x : F) (hx : x β ring.closure S) =>
Exists.intro x
(Exists.intro hx (Exists.intro 1 (Exists.intro is_submonoid.one_mem (div_one x))))
protected instance closure.is_submonoid {F : Type u_1} [field F] {S : set F} :
is_submonoid (closure S) :=
sorry
protected instance closure.is_subfield {F : Type u_1} [field F] {S : set F} :
is_subfield (closure S) :=
sorry
theorem mem_closure {F : Type u_1} [field F] {S : set F} {a : F} (ha : a β S) : a β closure S :=
ring_closure_subset (ring.mem_closure ha)
theorem subset_closure {F : Type u_1} [field F] {S : set F} : S β closure S :=
fun (_x : F) => mem_closure
theorem closure_subset {F : Type u_1} [field F] {S : set F} {T : set F} [is_subfield T]
(H : S β T) : closure S β T :=
sorry
theorem closure_subset_iff {F : Type u_1} [field F] (s : set F) (t : set F) [is_subfield t] :
closure s β t β s β t :=
{ mp := set.subset.trans subset_closure, mpr := closure_subset }
theorem closure_mono {F : Type u_1} [field F] {s : set F} {t : set F} (H : s β t) :
closure s β closure t :=
closure_subset (set.subset.trans H subset_closure)
end field
theorem is_subfield_Union_of_directed {F : Type u_1} [field F] {ΞΉ : Type u_2} [hΞΉ : Nonempty ΞΉ]
(s : ΞΉ β set F) [β (i : ΞΉ), is_subfield (s i)]
(directed : β (i j : ΞΉ), β (k : ΞΉ), s i β s k β§ s j β s k) :
is_subfield (set.Union fun (i : ΞΉ) => s i) :=
sorry
protected instance is_subfield.inter {F : Type u_1} [field F] (Sβ : set F) (Sβ : set F)
[is_subfield Sβ] [is_subfield Sβ] : is_subfield (Sβ β© Sβ) :=
is_subfield.mk
fun (x : F) (hx : x β Sβ β© Sβ) =>
{ left := is_subfield.inv_mem (and.left hx), right := is_subfield.inv_mem (and.right hx) }
protected instance is_subfield.Inter {F : Type u_1} [field F] {ΞΉ : Sort u_2} (S : ΞΉ β set F)
[h : β (y : ΞΉ), is_subfield (S y)] : is_subfield (set.Inter S) :=
is_subfield.mk
fun (x : F) (hx : x β set.Inter S) =>
iff.mpr set.mem_Inter fun (y : ΞΉ) => is_subfield.inv_mem (iff.mp set.mem_Inter hx y)
end Mathlib |
/-
Copyright (c) 2018 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
import tactic.suggest -- No other imports, for fast testing
/- Turn off trace messages so they don't pollute the test build: -/
set_option trace.silence_library_search true
/- For debugging purposes, we can display the list of lemmas: -/
-- set_option trace.suggest true
namespace test.library_search
-- Check that `library_search` fails if there are no goals.
example : true :=
begin
trivial,
success_if_fail { library_search },
end
-- Verify that `library_search` solves goals via `solve_by_elim` when the library isn't
-- even needed.
example (P : Prop) (p : P) : P :=
by library_search
example (P : Prop) (p : P) (np : Β¬P) : false :=
by library_search
example (X : Type) (P : Prop) (x : X) (h : Ξ x : X, x = x β P) : P :=
by library_search
example (Ξ± : Prop) : Ξ± β Ξ± :=
by library_search -- says: `exact id`
example (p : Prop) [decidable p] : (¬¬p) β p :=
by library_search -- says: `exact not_not.mp`
example (a b : Prop) (h : a β§ b) : a :=
by library_search -- says: `exact h.left`
example (P Q : Prop) [decidable P] [decidable Q]: (Β¬ Q β Β¬ P) β (P β Q) :=
by library_search -- says: `exact not_imp_not.mp`
example (a b : β) : a + b = b + a :=
by library_search -- says: `exact add_comm a b`
example (n m k : β) : n * (m - k) = n * m - n * k :=
by library_search -- says: `exact mul_tsub n m k`
example (n m k : β) : n * m - n * k = n * (m - k) :=
by library_search -- says: `exact eq.symm (mul_tsub n m k)`
example {Ξ± : Type} (x y : Ξ±) : x = y β y = x :=
by library_search -- says: `exact eq_comm`
example (a b : β) (ha : 0 < a) (hb : 0 < b) : 0 < a + b :=
by library_search -- says: `exact add_pos ha hb`
section synonym
-- Synonym `>` for `<` in another part of the goal
example (a b : β) (ha : a > 0) (hb : 0 < b) : 0 < a + b :=
by library_search -- says: `exact add_pos ha hb`
example (a b : β) (h : a β£ b) (w : b > 0) : a β€ b :=
by library_search -- says: `exact nat.le_of_dvd w h`
example (a b : β) (h : a β£ b) (w : b > 0) : b β₯ a :=
by library_search -- says: `exact nat.le_of_dvd w h`
-- A lemma with head symbol `Β¬` can be used to prove `Β¬ p` or `β₯`
example (a : β) : Β¬ (a < 0) := by library_search -- says `exact not_lt_bot`
example (a : β) (h : a < 0) : false := by library_search -- says `exact not_lt_bot h`
-- An inductive type hides the constructor's arguments enough
-- so that `library_search` doesn't accidentally close the goal.
inductive P : β β Prop
| gt_in_head {n : β} : n < 0 β P n
-- This lemma with `>` as its head symbol should also be found for goals with head symbol `<`.
lemma lemma_with_gt_in_head (a : β) (h : P a) : 0 > a := by { cases h, assumption }
-- This lemma with `false` as its head symbols should also be found for goals with head symbol `Β¬`.
lemma lemma_with_false_in_head (a b : β) (h1 : a < b) (h2 : P a) : false :=
by { apply nat.not_lt_zero, cases h2, assumption }
example (a : β) (h : P a) : 0 > a := by library_search -- says `exact lemma_with_gt_in_head a h`
example (a : β) (h : P a) : a < 0 := by library_search -- says `exact lemma_with_gt_in_head a h`
example (a b : β) (h1 : a < b) (h2 : P a) : false := by library_search
-- says `exact lemma_with_false_in_head a b h1 h2`
example (a b : β) (h1 : a < b) : Β¬ (P a) := by library_search!
-- says `exact lemma_with_false_in_head a b h1`
end synonym
-- We even find `iff` results:
example : β P : Prop, Β¬(P β Β¬P) :=
by library_search! -- says: `Ξ» (a : Prop), (iff_not_self a).mp`
example {a b c : β} (hβ : a β£ c) (hβ : a β£ b + c) : a β£ b :=
by library_search -- says `exact (nat.dvd_add_left hβ).mp hβ`
-- Checking examples from issue #2220
example {Ξ± : Sort*} (h : empty) : Ξ± :=
by library_search
example {Ξ± : Type*} (h : empty) : Ξ± :=
by library_search
def map_from_sum {A B C : Type} (f : A β C) (g : B β C) : (A β B) β C := by library_search
-- Test that we can set the transparency level in `apply`
-- to change how aggressively we unfold definitions while trying to apply lemmas.
lemma bind_singleton {Ξ± Ξ²} (x : Ξ±) (f : Ξ± β list Ξ²) : list.bind [x] f = f x :=
begin
success_if_fail {
library_search { md := tactic.transparency.reducible }, },
library_search!,
end
constant f : β β β
axiom F (a b : β) : f a β€ f b β a β€ b
example (a b : β) (h : a β€ b) : f a β€ f b := by library_search
-- Test #3432
theorem nonzero_gt_one (n : β) : Β¬ n = 0 β n β₯ 1 :=
by library_search! -- `exact nat.pos_of_ne_zero`
example (L : list (list β)) : list β :=
by library_search using L
example (n m : β) : β :=
by library_search using n m
example (P Q : list β) (h : β) : list β :=
by library_search using h Q
example (P Q : list β) (h : β) : list β :=
by library_search using P Q
-- Make sure `library_search` finds nothing when we list too many hypotheses after `using`.
example (P Q R S T : list β) : list β :=
begin
success_if_fail { library_search using P Q R S T, },
exact []
end
-- Tests for #3428
constants (x y w z : β)
axiom not_axiom : Β¬ x = y
axiom ne_axiom : w β z
example : x β y := by library_search
example : Β¬ w = z := by library_search
structure foo := (a : nat) (b : nat)
constants (k l : foo)
axiom ne_axiom' (h : k.a β 0) : k.b β 0
axiom not_axiom' (h : l.a β 0) : Β¬ l.b = 0
example (hq : k.a β 0) : k.b β 0 := by library_search
example (hq : l.a β 0) : Β¬ l.b = 0 := by library_search
end test.library_search
|
lemmas prime_dvd_power_int_iff = prime_dvd_power_iff[where ?'a = int] |
{-# OPTIONS --cumulativity #-}
open import Agda.Primitive
postulate
X : Set
P : (A : Set) β A β Set
id : β a (A : Set a) β A β A
works : P (X β X) (id (lsuc lzero) X)
fails : P _ (id (lsuc lzero) X)
|
/-
Copyright (c) 2019 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Riccardo Brasca, Johan Commelin
! This file was ported from Lean 3 source module field_theory.minpoly.field
! leanprover-community/mathlib commit cbdf7b565832144d024caa5a550117c6df0204a5
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Data.Polynomial.FieldDivision
import Mathbin.FieldTheory.Minpoly.Basic
import Mathbin.RingTheory.Algebraic
/-!
# Minimal polynomials on an algebra over a field
This file specializes the theory of minpoly to the setting of field extensions
and derives some well-known properties, amongst which the fact that minimal polynomials
are irreducible, and uniquely determined by their defining property.
-/
open Classical Polynomial
open Polynomial Set Function minpoly
namespace minpoly
variable {A B : Type _}
variable (A) [Field A]
section Ring
variable [Ring B] [Algebra A B] (x : B)
/-- If an element `x` is a root of a nonzero polynomial `p`, then the degree of `p` is at least the
degree of the minimal polynomial of `x`. See also `gcd_domain_degree_le_of_ne_zero` which relaxes
the assumptions on `A` in exchange for stronger assumptions on `B`. -/
theorem degree_le_of_ne_zero {p : A[X]} (pnz : p β 0) (hp : Polynomial.aeval x p = 0) :
degree (minpoly A x) β€ degree p :=
calc
degree (minpoly A x) β€ degree (p * C (leadingCoeff p)β»ΒΉ) :=
min A x (monic_mul_leadingCoeff_inv pnz) (by simp [hp])
_ = degree p := degree_mul_leadingCoeff_inv p pnz
#align minpoly.degree_le_of_ne_zero minpoly.degree_le_of_ne_zero
theorem ne_zero_of_finite_field_extension (e : B) [FiniteDimensional A B] : minpoly A e β 0 :=
minpoly.ne_zero <| isIntegral_of_noetherian (IsNoetherian.iff_fg.2 inferInstance) _
#align minpoly.ne_zero_of_finite_field_extension minpoly.ne_zero_of_finite_field_extension
/-- The minimal polynomial of an element `x` is uniquely characterized by its defining property:
if there is another monic polynomial of minimal degree that has `x` as a root, then this polynomial
is equal to the minimal polynomial of `x`. See also `minpoly.gcd_unique` which relaxes the
assumptions on `A` in exchange for stronger assumptions on `B`. -/
theorem unique {p : A[X]} (pmonic : p.Monic) (hp : Polynomial.aeval x p = 0)
(pmin : β q : A[X], q.Monic β Polynomial.aeval x q = 0 β degree p β€ degree q) :
p = minpoly A x := by
have hx : IsIntegral A x := β¨p, pmonic, hpβ©
symm; apply eq_of_sub_eq_zero
by_contra hnz
have := degree_le_of_ne_zero A x hnz (by simp [hp])
contrapose! this
apply degree_sub_lt _ (NeZero hx)
Β· rw [(monic hx).leadingCoeff, pmonic.leading_coeff]
Β· exact le_antisymm (min A x pmonic hp) (pmin (minpoly A x) (monic hx) (aeval A x))
#align minpoly.unique minpoly.unique
/-- If an element `x` is a root of a polynomial `p`, then the minimal polynomial of `x` divides `p`.
See also `minpoly.gcd_domain_dvd` which relaxes the assumptions on `A` in exchange for stronger
assumptions on `B`. -/
theorem dvd {p : A[X]} (hp : Polynomial.aeval x p = 0) : minpoly A x β£ p :=
by
by_cases hp0 : p = 0
Β· simp only [hp0, dvd_zero]
have hx : IsIntegral A x := by
rw [β isAlgebraic_iff_isIntegral]
exact β¨p, hp0, hpβ©
rw [β dvd_iff_mod_by_monic_eq_zero (monic hx)]
by_contra hnz
have := degree_le_of_ne_zero A x hnz _
Β· contrapose! this
exact degree_mod_by_monic_lt _ (monic hx)
Β· rw [β mod_by_monic_add_div p (monic hx)] at hp
simpa using hp
#align minpoly.dvd minpoly.dvd
theorem dvd_map_of_isScalarTower (A K : Type _) {R : Type _} [CommRing A] [Field K] [CommRing R]
[Algebra A K] [Algebra A R] [Algebra K R] [IsScalarTower A K R] (x : R) :
minpoly K x β£ (minpoly A x).map (algebraMap A K) :=
by
refine' minpoly.dvd K x _
rw [aeval_map_algebra_map, minpoly.aeval]
#align minpoly.dvd_map_of_is_scalar_tower minpoly.dvd_map_of_isScalarTower
theorem dvd_map_of_is_scalar_tower' (R : Type _) {S : Type _} (K L : Type _) [CommRing R]
[CommRing S] [Field K] [CommRing L] [Algebra R S] [Algebra R K] [Algebra S L] [Algebra K L]
[Algebra R L] [IsScalarTower R K L] [IsScalarTower R S L] (s : S) :
minpoly K (algebraMap S L s) β£ map (algebraMap R K) (minpoly R s) :=
by
apply minpoly.dvd K (algebraMap S L s)
rw [β map_aeval_eq_aeval_map, minpoly.aeval, map_zero]
rw [β IsScalarTower.algebraMap_eq, β IsScalarTower.algebraMap_eq]
#align minpoly.dvd_map_of_is_scalar_tower' minpoly.dvd_map_of_is_scalar_tower'
/-- If `y` is a conjugate of `x` over a field `K`, then it is a conjugate over a subring `R`. -/
theorem aeval_of_isScalarTower (R : Type _) {K T U : Type _} [CommRing R] [Field K] [CommRing T]
[Algebra R K] [Algebra K T] [Algebra R T] [IsScalarTower R K T] [CommSemiring U] [Algebra K U]
[Algebra R U] [IsScalarTower R K U] (x : T) (y : U)
(hy : Polynomial.aeval y (minpoly K x) = 0) : Polynomial.aeval y (minpoly R x) = 0 :=
aeval_map_algebraMap K y (minpoly R x) βΈ
evalβ_eq_zero_of_dvd_of_evalβ_eq_zero (algebraMap K U) y
(minpoly.dvd_map_of_isScalarTower R K x) hy
#align minpoly.aeval_of_is_scalar_tower minpoly.aeval_of_isScalarTower
variable {A x}
theorem eq_of_irreducible_of_monic [Nontrivial B] {p : A[X]} (hp1 : Irreducible p)
(hp2 : Polynomial.aeval x p = 0) (hp3 : p.Monic) : p = minpoly A x :=
let β¨q, hqβ© := dvd A x hp2
eq_of_monic_of_associated hp3 (monic β¨p, β¨hp3, hp2β©β©) <|
mul_one (minpoly A x) βΈ hq.symm βΈ Associated.mul_left _ <|
associated_one_iff_isUnit.2 <| (hp1.isUnit_or_isUnit hq).resolve_left <| not_isUnit A x
#align minpoly.eq_of_irreducible_of_monic minpoly.eq_of_irreducible_of_monic
theorem eq_of_irreducible [Nontrivial B] {p : A[X]} (hp1 : Irreducible p)
(hp2 : Polynomial.aeval x p = 0) : p * C p.leadingCoeffβ»ΒΉ = minpoly A x :=
by
have : p.leading_coeff β 0 := leading_coeff_ne_zero.mpr hp1.ne_zero
apply eq_of_irreducible_of_monic
Β·
exact
Associated.irreducible
β¨β¨C p.leading_coeffβ»ΒΉ, C p.leading_coeff, by rwa [β C_mul, inv_mul_cancel, C_1], by
rwa [β C_mul, mul_inv_cancel, C_1]β©,
rflβ©
hp1
Β· rw [aeval_mul, hp2, MulZeroClass.zero_mul]
Β· rwa [Polynomial.Monic, leading_coeff_mul, leading_coeff_C, mul_inv_cancel]
#align minpoly.eq_of_irreducible minpoly.eq_of_irreducible
/-- If `y` is the image of `x` in an extension, their minimal polynomials coincide.
We take `h : y = algebra_map L T x` as an argument because `rw h` typically fails
since `is_integral R y` depends on y.
-/
theorem eq_of_algebraMap_eq {K S T : Type _} [Field K] [CommRing S] [CommRing T] [Algebra K S]
[Algebra K T] [Algebra S T] [IsScalarTower K S T] (hST : Function.Injective (algebraMap S T))
{x : S} {y : T} (hx : IsIntegral K x) (h : y = algebraMap S T x) : minpoly K x = minpoly K y :=
minpoly.unique _ _ (minpoly.monic hx)
(by rw [h, aeval_algebra_map_apply, minpoly.aeval, RingHom.map_zero]) fun q q_monic root_q =>
minpoly.min _ _ q_monic
((aeval_algebraMap_eq_zero_iff_of_injective hST).mp
(h βΈ root_q : Polynomial.aeval (algebraMap S T x) q = 0))
#align minpoly.eq_of_algebra_map_eq minpoly.eq_of_algebraMap_eq
theorem add_algebraMap {B : Type _} [CommRing B] [Algebra A B] {x : B} (hx : IsIntegral A x)
(a : A) : minpoly A (x + algebraMap A B a) = (minpoly A x).comp (X - C a) :=
by
refine' (minpoly.unique _ _ ((minpoly.monic hx).comp_X_sub_C _) _ fun q qmo hq => _).symm
Β· simp [aeval_comp]
Β· have : (Polynomial.aeval x) (q.comp (X + C a)) = 0 := by simpa [aeval_comp] using hq
have H := minpoly.min A x (qmo.comp_X_add_C _) this
rw [degree_eq_nat_degree qmo.ne_zero,
degree_eq_nat_degree ((minpoly.monic hx).comp_X_sub_C _).NeZero, WithBot.coe_le_coe,
nat_degree_comp, nat_degree_X_sub_C, mul_one]
rwa [degree_eq_nat_degree (minpoly.ne_zero hx),
degree_eq_nat_degree (qmo.comp_X_add_C _).NeZero, WithBot.coe_le_coe, nat_degree_comp,
nat_degree_X_add_C, mul_one] at H
#align minpoly.add_algebra_map minpoly.add_algebraMap
theorem sub_algebraMap {B : Type _} [CommRing B] [Algebra A B] {x : B} (hx : IsIntegral A x)
(a : A) : minpoly A (x - algebraMap A B a) = (minpoly A x).comp (X + C a) := by
simpa [sub_eq_add_neg] using add_algebra_map hx (-a)
#align minpoly.sub_algebra_map minpoly.sub_algebraMap
section AlgHomFintype
/-- A technical finiteness result. -/
noncomputable def Fintype.subtypeProd {E : Type _} {X : Set E} (hX : X.Finite) {L : Type _}
(F : E β Multiset L) : Fintype (β x : X, { l : L // l β F x }) :=
let hX := Finite.fintype hX
Pi.fintype
#align minpoly.fintype.subtype_prod minpoly.Fintype.subtypeProd
variable (F E K : Type _) [Field F] [Ring E] [CommRing K] [IsDomain K] [Algebra F E] [Algebra F K]
[FiniteDimensional F E]
-- Marked as `noncomputable!` since this definition takes multiple seconds to compile,
-- and isn't very computable in practice (since neither `finrank` nor `fin_basis` are).
/-- Function from Hom_K(E,L) to pi type Ξ (x : basis), roots of min poly of x -/
noncomputable def rootsOfMinPolyPiType (Ο : E ββ[F] K)
(x : range (FiniteDimensional.finBasis F E : _ β E)) :
{ l : K // l β (((minpoly F x.1).map (algebraMap F K)).roots : Multiset K) } :=
β¨Ο x, by
rw [mem_roots_map (minpoly.ne_zero_of_finite_field_extension F x.val), Subtype.val_eq_coe, β
aeval_def, aeval_alg_hom_apply, minpoly.aeval, map_zero]β©
#align minpoly.roots_of_min_poly_pi_type minpoly.rootsOfMinPolyPiType
theorem aux_inj_roots_of_min_poly : Injective (rootsOfMinPolyPiType F E K) :=
by
intro f g h
suffices (f : E ββ[F] K) = g by rwa [FunLike.ext'_iff] at thisβ’
rw [funext_iff] at h
exact
LinearMap.ext_on (FiniteDimensional.finBasis F E).span_eq fun e he =>
subtype.ext_iff.mp (h β¨e, heβ©)
#align minpoly.aux_inj_roots_of_min_poly minpoly.aux_inj_roots_of_min_poly
/-- Given field extensions `E/F` and `K/F`, with `E/F` finite, there are finitely many `F`-algebra
homomorphisms `E ββ[K] K`. -/
noncomputable instance AlgHom.fintype : Fintype (E ββ[F] K) :=
@Fintype.ofInjective _ _
(Fintype.subtypeProd (finite_range (FiniteDimensional.finBasis F E)) fun e =>
((minpoly F e).map (algebraMap F K)).roots)
_ (aux_inj_roots_of_min_poly F E K)
#align minpoly.alg_hom.fintype minpoly.AlgHom.fintype
end AlgHomFintype
variable (B) [Nontrivial B]
/-- If `B/K` is a nontrivial algebra over a field, and `x` is an element of `K`,
then the minimal polynomial of `algebra_map K B x` is `X - C x`. -/
theorem eq_x_sub_c (a : A) : minpoly A (algebraMap A B a) = X - C a :=
eq_x_sub_c_of_algebraMap_inj a (algebraMap A B).Injective
#align minpoly.eq_X_sub_C minpoly.eq_x_sub_c
theorem eq_x_sub_C' (a : A) : minpoly A a = X - C a :=
eq_x_sub_c A a
#align minpoly.eq_X_sub_C' minpoly.eq_x_sub_C'
variable (A)
/-- The minimal polynomial of `0` is `X`. -/
@[simp]
theorem zero : minpoly A (0 : B) = X := by
simpa only [add_zero, C_0, sub_eq_add_neg, neg_zero, RingHom.map_zero] using eq_X_sub_C B (0 : A)
#align minpoly.zero minpoly.zero
/-- The minimal polynomial of `1` is `X - 1`. -/
@[simp]
theorem one : minpoly A (1 : B) = X - 1 := by
simpa only [RingHom.map_one, C_1, sub_eq_add_neg] using eq_X_sub_C B (1 : A)
#align minpoly.one minpoly.one
end Ring
section IsDomain
variable [Ring B] [IsDomain B] [Algebra A B]
variable {A} {x : B}
/-- A minimal polynomial is prime. -/
theorem prime (hx : IsIntegral A x) : Prime (minpoly A x) :=
by
refine' β¨NeZero hx, not_is_unit A x, _β©
rintro p q β¨d, hβ©
have : Polynomial.aeval x (p * q) = 0 := by simp [h, aeval A x]
replace : Polynomial.aeval x p = 0 β¨ Polynomial.aeval x q = 0 := by simpa
exact Or.imp (dvd A x) (dvd A x) this
#align minpoly.prime minpoly.prime
/-- If `L/K` is a field extension and an element `y` of `K` is a root of the minimal polynomial
of an element `x β L`, then `y` maps to `x` under the field embedding. -/
theorem root {x : B} (hx : IsIntegral A x) {y : A} (h : IsRoot (minpoly A x) y) :
algebraMap A B y = x :=
by
have key : minpoly A x = X - C y :=
eq_of_monic_of_associated (monic hx) (monic_X_sub_C y)
(associated_of_dvd_dvd
((irreducible_X_sub_C y).dvd_symm (irreducible hx) (dvd_iff_isRoot.2 h))
(dvd_iff_isRoot.2 h))
have := aeval A x
rwa [key, AlgHom.map_sub, aeval_X, aeval_C, sub_eq_zero, eq_comm] at this
#align minpoly.root minpoly.root
/-- The constant coefficient of the minimal polynomial of `x` is `0` if and only if `x = 0`. -/
@[simp]
theorem coeff_zero_eq_zero (hx : IsIntegral A x) : coeff (minpoly A x) 0 = 0 β x = 0 :=
by
constructor
Β· intro h
have zero_root := zero_is_root_of_coeff_zero_eq_zero h
rw [β root hx zero_root]
exact RingHom.map_zero _
Β· rintro rfl
simp
#align minpoly.coeff_zero_eq_zero minpoly.coeff_zero_eq_zero
/-- The minimal polynomial of a nonzero element has nonzero constant coefficient. -/
theorem coeff_zero_ne_zero (hx : IsIntegral A x) (h : x β 0) : coeff (minpoly A x) 0 β 0 :=
by
contrapose! h
simpa only [hx, coeff_zero_eq_zero] using h
#align minpoly.coeff_zero_ne_zero minpoly.coeff_zero_ne_zero
end IsDomain
end minpoly
|
g1 : Nat -> Nat
g1 x = 5
--g1 _ = 6
g2 : (Nat, Nat) -> Nat
g2 (x, y) = x
--g2 (a, b) = 6
g3 : (Nat, Nat) -> Nat
g3 (x, y) = x
g3 _ = 6
f : Monad m => m (Nat, Nat)
h2 : Monad m => m Nat
h2 = do
(x, y) <- f
-- | (a, b) => pure 5
pure x
h3 : Monad m => m Nat
h3 = do
(x, y) <- f
| _ => pure 5
pure x
|
module index where
-- For a brief presentation of every single module, head over to
import Everything
-- Otherwise, here is an exhaustive, stern list of all the available modules.
|
data Baz : Int -> Type where
AddThings : (x : Int) -> (y : Int) -> Baz (x + y)
addBaz : (x : Int) -> Baz x -> Int
addBaz (x + y) (AddThings x z) = x + y
|
_throw_table_error() = throw(ArgumentError("Please specify the column that contains the targets explicitly, or provide a target-extraction-function as first parameter. see parameter 'f' in ?targets."))
# required data container interface
LearnBase.nobs(dt::AbstractDataFrame) = DataFrames.nrow(dt)
LearnBase.getobs(dt::AbstractDataFrame, idx) = dt[idx,:]
LearnBase.nobs(dt::DataFrameRow) = 1 # it is a observation
function LearnBase.getobs(dt::DataFrameRow, idx)
idx == 1:1 || throw(ArgumentError(
"Attempting to read multiple rows ($idx) with a single row"))
return dt
end
# custom data subset in form of SubDataFrame
LearnBase.datasubset(dt::AbstractDataFrame, idx, ::ObsDim.Undefined) =
@view dt[idx, :]
# throw error if no target extraction function is supplied
LearnBase.gettarget(::typeof(identity), dt::AbstractDataFrame) =
_throw_table_error()
LearnBase.gettarget(::typeof(identity), dt::DataFrameRow) =
_throw_table_error()
# convenience syntax to allow column name
LearnBase.gettarget(col::Symbol, dt::AbstractDataFrame) = dt[1, col]
LearnBase.gettarget(col::Symbol, dt::DataFrameRow) = dt[col]
LearnBase.gettarget(fun, dt::AbstractDataFrame) = fun(dt)
# avoid copy when target extraction function is supplied
MLDataPattern.getobs_targetfun(dt::AbstractDataFrame) = dt
# --------------------------------------------------------------------
#= Use Requires.jl once fixed for 0.6
import DataTables: DataTables, AbstractDataTable
# required data container interface
LearnBase.nobs(dt::AbstractDataTable) = DataTables.nrow(dt)
LearnBase.getobs(dt::AbstractDataTable, idx) = dt[idx,:]
# custom data subset in form of SubDataFrame
LearnBase.datasubset(dt::AbstractDataTable, idx, ::ObsDim.Undefined) =
view(dt, idx)
# throw error if no target extraction function is supplied
LearnBase.gettarget(dt::AbstractDataTable) = _throw_table_error()
# convenience syntax to allow column name
LearnBase.gettarget(col::Symbol, dt::AbstractDataTable) = dt[1, col]
# avoid copy when target extraction function is supplied
MLDataPattern.getobs_targetfun(dt::AbstractDataTable) = dt
=#
|
* MB04UD EXAMPLE PROGRAM TEXT
* Copyright (c) 2002-2020 NICONET e.V.
*
* .. Parameters ..
INTEGER NIN, NOUT
PARAMETER ( NIN = 5, NOUT = 6 )
INTEGER MMAX, NMAX
PARAMETER ( MMAX = 20, NMAX = 20 )
INTEGER LDA, LDE, LDQ, LDZ
PARAMETER ( LDA = MMAX, LDE = MMAX, LDQ = MMAX,
$ LDZ = NMAX )
INTEGER LDWORK
PARAMETER ( LDWORK = MAX( NMAX,MMAX ) )
* PARAMETER ( LDWORK = NMAX+MMAX )
* .. Local Scalars ..
DOUBLE PRECISION TOL
INTEGER I, INFO, J, M, N, RANKE
CHARACTER*1 JOBQ, JOBZ
* .. Local Arrays ..
DOUBLE PRECISION A(LDA,NMAX), DWORK(LDWORK), E(LDE,NMAX),
$ Q(LDQ,MMAX), Z(LDZ,NMAX)
INTEGER ISTAIR(MMAX)
* .. External Subroutines ..
EXTERNAL MB04UD
* .. Intrinsic Functions ..
INTRINSIC MAX
* .. Executable Statements ..
*
WRITE ( NOUT, FMT = 99999 )
* Skip the heading in the data file and read the data.
READ ( NIN, FMT = '()' )
READ ( NIN, FMT = * ) M, N, TOL
IF ( M.LT.0 .OR. M.GT.MMAX ) THEN
WRITE ( NOUT, FMT = 99993 ) M
ELSE IF ( N.LT.0 .OR. N.GT.NMAX ) THEN
WRITE ( NOUT, FMT = 99992 ) N
ELSE
READ ( NIN, FMT = * ) ( ( A(I,J), J = 1,N ), I = 1,M )
READ ( NIN, FMT = * ) ( ( E(I,J), J = 1,N ), I = 1,M )
JOBQ = 'N'
JOBZ = 'N'
* Reduce E to column echelon form and compute Q'*A*Z.
CALL MB04UD( JOBQ, JOBZ, M, N, A, LDA, E, LDE, Q, LDQ, Z, LDZ,
$ RANKE, ISTAIR, TOL, DWORK, INFO )
*
IF ( INFO.NE.0 ) THEN
WRITE ( NOUT, FMT = 99998 ) INFO
ELSE
WRITE ( NOUT, FMT = 99991 )
DO 10 I = 1, M
WRITE ( NOUT, FMT = 99996 ) ( A(I,J), J = 1,N )
10 CONTINUE
WRITE ( NOUT, FMT = 99997 )
DO 100 I = 1, M
WRITE ( NOUT, FMT = 99996 ) ( E(I,J), J = 1,N )
100 CONTINUE
WRITE ( NOUT, FMT = 99995 ) RANKE
WRITE ( NOUT, FMT = 99994 ) ( ISTAIR(I), I = 1,M )
END IF
END IF
STOP
*
99999 FORMAT (' MB04UD EXAMPLE PROGRAM RESULTS',/1X)
99998 FORMAT (' INFO on exit from MB04UD = ',I2)
99997 FORMAT (' The transformed matrix E is ')
99996 FORMAT (20(1X,F8.4))
99995 FORMAT (/' The computed rank of E = ',I2)
99994 FORMAT (/' ISTAIR is ',/20(1X,I5))
99993 FORMAT (/' M is out of range.',/' M = ',I5)
99992 FORMAT (/' N is out of range.',/' N = ',I5)
99991 FORMAT (' The transformed matrix A is ')
END
|
function weight = subset_weight ( n, t )
%*****************************************************************************80
%
%% SUBSET_WEIGHT computes the Hamming weight of a set.
%
% Discussion:
%
% The Hamming weight is simply the number of elements in the set.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 22 August 2011
%
% Author:
%
% John Burkardt
%
% Reference:
%
% Donald Kreher, Douglas Simpson,
% Combinatorial Algorithms,
% CRC Press, 1998,
% ISBN: 0-8493-3988-X,
% LC: QA164.K73.
%
% Parameters:
%
% Input, integer N, the order of the master set, of which T
% is a subset. N must be positive.
%
% Input, integer T(N), defines the subset T.
% T(I) is 1 if I is an element of T, and 0 otherwise.
%
% Output, integer WEIGHT, the Hamming weight of the subset T.
%
%
% Check.
%
subset_check ( n, t );
weight = sum ( t(1:n) );
return
end
|
%% Copyright (C) 2014-2016, 2019, 2022-2023 Colin B. Macdonald
%% Copyright (C) 2016 Lagu
%% Copyright (C) 2016 Abhinav Tripathi
%% Copyright (C) 2017 NVS Abhilash
%% Copyright (C) 2020 Fernando Alvarruiz
%%
%% This file is part of OctSymPy.
%%
%% OctSymPy is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published
%% by the Free Software Foundation; either version 3 of the License,
%% or (at your option) any later version.
%%
%% This software is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty
%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
%% the GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public
%% License along with this software; see the file COPYING.
%% If not, see <http://www.gnu.org/licenses/>.
%% -*- texinfo -*-
%% @defun mat_replace (@var{A}, @var{subs}, @var{rhs})
%% Private helper routine for setting symbolic array entries.
%%
%% @end defun
function z = mat_replace(A, subs, b)
if (length (subs) == 1 && islogical (subs{1}))
%% A(logical) = B
subs{1} = find (subs{1});
if isempty (subs{1})
z = A;
return;
end
end
%% Check when b is []
if (isempty(b))
switch length(subs)
case 1
if strcmp(subs{1}, ':')
z = sym([]);
return
end
if (isempty (subs{1}))
z = A;
return
end
if rows(A) == 1
z = delete_col(A, subs{1});
return
elseif columns(A) == 1
z = delete_row(A, subs{1});
return
else
z = sym([]);
for i=1:A.size(2)
z = [z subsref(A, substruct ('()', {':', i})).'];
end
z = subsasgn (z, substruct ('()', {subs{1}}), []);
return
end
case 2
if (isempty (subs{1}) || isempty (subs{2}))
z = A;
return
end
if strcmp(subs{1}, ':')
if strcmp(subs{2}, ':')
z = sym(zeros(0,columns(A)));
return
else
z = delete_col(A, subs{2});
return
end
elseif strcmp(subs{2}, ':')
z = delete_row(A, subs{1});
return
else
error('A null assignment can only have one non-colon index.'); % Standard octave error
end
otherwise
error('Unexpected subs input')
end
end
if (length(subs) == 1 && strcmp(subs{1}, ':') && length(b) == 1)
z = pycall_sympy__ ('return ones(_ins[0], _ins[1])*_ins[2],', uint64(A.size(1)), uint64(A.size(2)), sym(b));
return
elseif (length(subs) == 1)
% can use a single index to grow a vector, so we carefully deal with
% vector vs linear index to matrix (not required for access)
[n,m] = size(A);
if (n == 0 || n == 1)
c = subs{1}; r = ones(size(c));
elseif (m == 1)
r = subs{1}; c = ones(size(r));
else
% linear indices into 2D array
% Octave 8 does not raise error from ind2sub so we do it ourselves
sz = size (A);
i = subs{1};
if (i > prod (sz))
error ('%d is out of bound %d (dimensions are %dx%d)\n', i, prod (sz), sz)
end
[r, c] = ind2sub (size (A), i);
% keep all the indices in a row vector
r = reshape (r, 1, []);
c = reshape (c, 1, []);
end
elseif (length(subs) == 2)
r = subs{1};
c = subs{2};
[n,m] = size(A);
if (isnumeric(r) && ((isvector(r) || isempty(r))))
% no-op
elseif (strcmp(r,':'))
r = 1:n;
elseif (islogical(r) && isvector(r) && (length(r) == n))
I = r;
r = 1:n; r = r(I);
else
error('unknown 2d-indexing in rows')
end
if (isnumeric(c) && ((isvector(c) || isempty(c))))
% no-op
elseif (strcmp(c,':'))
c = 1:m;
elseif (islogical(c) && isvector(c) && (length(c) == m))
J = c;
c = 1:m; c = c(J);
else
error('unknown 2d-indexing in columns')
end
[r,c] = ndgrid(r,c);
if ~(isscalar (b) || (isvector (r) && isvector (b)) || is_same_shape (r, b))
% vectors may have diff orientations but if we have matrices then
% they must have the same shape (Octave/Matlab do this for double)
error('A(I,J,...) = X: dimensions mismatch')
end
r = r(:);
c = c(:);
else
error('unknown indexing')
end
z = mat_rclist_asgn(A, r, c, b);
end
function z = delete_col(A, subs)
if isscalar (A)
z = sym(zeros (1, 0));
else
cmd = { 'A, subs = _ins'
'if isinstance(subs, Integer):'
' A.col_del(subs - 1)'
' return A,'
'for i in sorted(subs, reverse=True):'
' A.col_del(i - 1)'
'return A,' };
z = pycall_sympy__ (cmd, A, sym(subs));
end
end
function z = delete_row(A, subs)
if isscalar (A)
% no test coverage: not sure how to hit this
z = sym(zeros (0, 1));
else
cmd = { 'A, subs = _ins'
'if isinstance(subs, Integer):'
' A.row_del(subs - 1)'
' return A,'
'for i in sorted(subs, reverse=True):'
' A.row_del(i - 1)'
'return A,' };
z = pycall_sympy__ (cmd, A, sym(subs));
end
end
|
/-
Copyright (c) 2017 Johannes HΓΆlzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes HΓΆlzl, Mario Carneiro, Patrick Massot
-/
import order.filter.small_sets
import topology.subset_properties
/-!
# Uniform spaces
Uniform spaces are a generalization of metric spaces and topological groups. Many concepts directly
generalize to uniform spaces, e.g.
* uniform continuity (in this file)
* completeness (in `cauchy.lean`)
* extension of uniform continuous functions to complete spaces (in `uniform_embedding.lean`)
* totally bounded sets (in `cauchy.lean`)
* totally bounded complete sets are compact (in `cauchy.lean`)
A uniform structure on a type `X` is a filter `π€ X` on `X Γ X` satisfying some conditions
which makes it reasonable to say that `βαΆ (p : X Γ X) in π€ X, ...` means
"for all p.1 and p.2 in X close enough, ...". Elements of this filter are called entourages
of `X`. The two main examples are:
* If `X` is a metric space, `V β π€ X β β Ξ΅ > 0, { p | dist p.1 p.2 < Ξ΅ } β V`
* If `G` is an additive topological group, `V β π€ G β β U β π (0 : G), {p | p.2 - p.1 β U} β V`
Those examples are generalizations in two different directions of the elementary example where
`X = β` and `V β π€ β β β Ξ΅ > 0, { p | |p.2 - p.1| < Ξ΅ } β V` which features both the topological
group structure on `β` and its metric space structure.
Each uniform structure on `X` induces a topology on `X` characterized by
> `nhds_eq_comap_uniformity : β {x : X}, π x = comap (prod.mk x) (π€ X)`
where `prod.mk x : X β X Γ X := (Ξ» y, (x, y))` is the partial evaluation of the product
constructor.
The dictionary with metric spaces includes:
* an upper bound for `dist x y` translates into `(x, y) β V` for some `V β π€ X`
* a ball `ball x r` roughly corresponds to `uniform_space.ball x V := {y | (x, y) β V}`
for some `V β π€ X`, but the later is more general (it includes in
particular both open and closed balls for suitable `V`).
In particular we have:
`is_open_iff_ball_subset {s : set X} : is_open s β β x β s, β V β π€ X, ball x V β s`
The triangle inequality is abstracted to a statement involving the composition of relations in `X`.
First note that the triangle inequality in a metric space is equivalent to
`β (x y z : X) (r r' : β), dist x y β€ r β dist y z β€ r' β dist x z β€ r + r'`.
Then, for any `V` and `W` with type `set (X Γ X)`, the composition `V β W : set (X Γ X)` is
defined as `{ p : X Γ X | β z, (p.1, z) β V β§ (z, p.2) β W }`.
In the metric space case, if `V = { p | dist p.1 p.2 β€ r }` and `W = { p | dist p.1 p.2 β€ r' }`
then the triangle inequality, as reformulated above, says `V β W` is contained in
`{p | dist p.1 p.2 β€ r + r'}` which is the entourage associated to the radius `r + r'`.
In general we have `mem_ball_comp (h : y β ball x V) (h' : z β ball y W) : z β ball x (V β W)`.
Note that this discussion does not depend on any axiom imposed on the uniformity filter,
it is simply captured by the definition of composition.
The uniform space axioms ask the filter `π€ X` to satisfy the following:
* every `V β π€ X` contains the diagonal `id_rel = { p | p.1 = p.2 }`. This abstracts the fact
that `dist x x β€ r` for every non-negative radius `r` in the metric space case and also that
`x - x` belongs to every neighborhood of zero in the topological group case.
* `V β π€ X β prod.swap '' V β π€ X`. This is tightly related the fact that `dist x y = dist y x`
in a metric space, and to continuity of negation in the topological group case.
* `β V β π€ X, β W β π€ X, W β W β V`. In the metric space case, it corresponds
to cutting the radius of a ball in half and applying the triangle inequality.
In the topological group case, it comes from continuity of addition at `(0, 0)`.
These three axioms are stated more abstractly in the definition below, in terms of
operations on filters, without directly manipulating entourages.
##Β Main definitions
* `uniform_space X` is a uniform space structure on a type `X`
* `uniform_continuous f` is a predicate saying a function `f : Ξ± β Ξ²` between uniform spaces
is uniformly continuous : `β r β π€ Ξ², βαΆ (x : Ξ± Γ Ξ±) in π€ Ξ±, (f x.1, f x.2) β r`
In this file we also define a complete lattice structure on the type `uniform_space X`
of uniform structures on `X`, as well as the pullback (`uniform_space.comap`) of uniform structures
coming from the pullback of filters.
Like distance functions, uniform structures cannot be pushed forward in general.
## Notations
Localized in `uniformity`, we have the notation `π€ X` for the uniformity on a uniform space `X`,
and `β` for composition of relations, seen as terms with type `set (X Γ X)`.
## Implementation notes
There is already a theory of relations in `data/rel.lean` where the main definition is
`def rel (Ξ± Ξ² : Type*) := Ξ± β Ξ² β Prop`.
The relations used in the current file involve only one type, but this is not the reason why
we don't reuse `data/rel.lean`. We use `set (Ξ± Γ Ξ±)`
instead of `rel Ξ± Ξ±` because we really need sets to use the filter library, and elements
of filters on `Ξ± Γ Ξ±` have type `set (Ξ± Γ Ξ±)`.
The structure `uniform_space X` bundles a uniform structure on `X`, a topology on `X` and
an assumption saying those are compatible. This may not seem mathematically reasonable at first,
but is in fact an instance of the forgetful inheritance pattern. See Note [forgetful inheritance]
below.
## References
The formalization uses the books:
* [N. Bourbaki, *General Topology*][bourbaki1966]
* [I. M. James, *Topologies and Uniformities*][james1999]
But it makes a more systematic use of the filter library.
-/
open set filter classical
open_locale classical topological_space filter
set_option eqn_compiler.zeta true
universes u
/-!
### Relations, seen as `set (Ξ± Γ Ξ±)`
-/
variables {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {Ξ΄ : Type*} {ΞΉ : Sort*}
/-- The identity relation, or the graph of the identity function -/
def id_rel {Ξ± : Type*} := {p : Ξ± Γ Ξ± | p.1 = p.2}
@[simp] theorem mem_id_rel {a b : Ξ±} : (a, b) β @id_rel Ξ± β a = b := iff.rfl
@[simp] theorem id_rel_subset {s : set (Ξ± Γ Ξ±)} : id_rel β s β β a, (a, a) β s :=
by simp [subset_def]; exact forall_congr (Ξ» a, by simp)
/-- The composition of relations -/
def comp_rel {Ξ± : Type u} (rβ rβ : set (Ξ±ΓΞ±)) := {p : Ξ± Γ Ξ± | βz:Ξ±, (p.1, z) β rβ β§ (z, p.2) β rβ}
localized "infix ` β `:55 := comp_rel" in uniformity
@[simp] theorem mem_comp_rel {rβ rβ : set (Ξ±ΓΞ±)}
{x y : Ξ±} : (x, y) β rβ β rβ β β z, (x, z) β rβ β§ (z, y) β rβ := iff.rfl
@[simp] theorem swap_id_rel : prod.swap '' id_rel = @id_rel Ξ± :=
set.ext $ assume β¨a, bβ©, by simp [image_swap_eq_preimage_swap]; exact eq_comm
theorem monotone_comp_rel [preorder Ξ²] {f g : Ξ² β set (Ξ±ΓΞ±)}
(hf : monotone f) (hg : monotone g) : monotone (Ξ»x, (f x) β (g x)) :=
assume a b h p β¨z, hβ, hββ©, β¨z, hf h hβ, hg h hββ©
@[mono]
lemma comp_rel_mono {f g h k: set (Ξ±ΓΞ±)} (hβ : f β h) (hβ : g β k) : f β g β h β k :=
Ξ» β¨x, yβ© β¨z, h, h'β©, β¨z, hβ h, hβ h'β©
lemma prod_mk_mem_comp_rel {a b c : Ξ±} {s t : set (Ξ±ΓΞ±)} (hβ : (a, c) β s) (hβ : (c, b) β t) :
(a, b) β s β t :=
β¨c, hβ, hββ©
@[simp] lemma id_comp_rel {r : set (Ξ±ΓΞ±)} : id_rel β r = r :=
set.ext $ assume β¨a, bβ©, by simp
lemma comp_rel_assoc {r s t : set (Ξ±ΓΞ±)} :
(r β s) β t = r β (s β t) :=
by ext p; cases p; simp only [mem_comp_rel]; tauto
lemma left_subset_comp_rel {s t : set (Ξ± Γ Ξ±)} (h : id_rel β t) : s β s β t :=
Ξ» β¨x, yβ© xy_in, β¨y, xy_in, h $ by exact rflβ©
lemma right_subset_comp_rel {s t : set (Ξ± Γ Ξ±)} (h : id_rel β s) : t β s β t :=
Ξ» β¨x, yβ© xy_in, β¨x, h $ by exact rfl, xy_inβ©
lemma subset_comp_self {s : set (Ξ± Γ Ξ±)} (h : id_rel β s) : s β s β s :=
left_subset_comp_rel h
lemma subset_iterate_comp_rel {s t : set (Ξ± Γ Ξ±)} (h : id_rel β s) (n : β) :
t β (((β) s) ^[n] t) :=
begin
induction n with n ihn generalizing t,
exacts [subset.rfl, (right_subset_comp_rel h).trans ihn]
end
/-- The relation is invariant under swapping factors. -/
def symmetric_rel (V : set (Ξ± Γ Ξ±)) : Prop := prod.swap β»ΒΉ' V = V
/-- The maximal symmetric relation contained in a given relation. -/
def symmetrize_rel (V : set (Ξ± Γ Ξ±)) : set (Ξ± Γ Ξ±) := V β© prod.swap β»ΒΉ' V
lemma symmetric_symmetrize_rel (V : set (Ξ± Γ Ξ±)) : symmetric_rel (symmetrize_rel V) :=
by simp [symmetric_rel, symmetrize_rel, preimage_inter, inter_comm, β preimage_comp]
lemma symmetrize_rel_subset_self (V : set (Ξ± Γ Ξ±)) : symmetrize_rel V β V :=
sep_subset _ _
@[mono]
lemma symmetrize_mono {V W: set (Ξ± Γ Ξ±)} (h : V β W) : symmetrize_rel V β symmetrize_rel W :=
inter_subset_inter h $ preimage_mono h
lemma symmetric_rel.mk_mem_comm {V : set (Ξ± Γ Ξ±)} (hV : symmetric_rel V) {x y : Ξ±} :
(x, y) β V β (y, x) β V :=
set.ext_iff.1 hV (y, x)
lemma symmetric_rel_inter {U V : set (Ξ± Γ Ξ±)} (hU : symmetric_rel U) (hV : symmetric_rel V) :
symmetric_rel (U β© V) :=
begin
unfold symmetric_rel at *,
rw [preimage_inter, hU, hV],
end
/-- This core description of a uniform space is outside of the type class hierarchy. It is useful
for constructions of uniform spaces, when the topology is derived from the uniform space. -/
structure uniform_space.core (Ξ± : Type u) :=
(uniformity : filter (Ξ± Γ Ξ±))
(refl : π id_rel β€ uniformity)
(symm : tendsto prod.swap uniformity uniformity)
(comp : uniformity.lift' (Ξ»s, s β s) β€ uniformity)
/-- An alternative constructor for `uniform_space.core`. This version unfolds various
`filter`-related definitions. -/
def uniform_space.core.mk' {Ξ± : Type u} (U : filter (Ξ± Γ Ξ±))
(refl : β (r β U) x, (x, x) β r)
(symm : β r β U, prod.swap β»ΒΉ' r β U)
(comp : β r β U, β t β U, t β t β r) : uniform_space.core Ξ± :=
β¨U, Ξ» r ru, id_rel_subset.2 (refl _ ru), symm,
begin
intros r ru,
rw [mem_lift'_sets],
exact comp _ ru,
apply monotone_comp_rel; exact monotone_id,
endβ©
/-- Defining an `uniform_space.core` from a filter basis satisfying some uniformity-like axioms. -/
def uniform_space.core.mk_of_basis {Ξ± : Type u} (B : filter_basis (Ξ± Γ Ξ±))
(refl : β (r β B) x, (x, x) β r)
(symm : β r β B, β t β B, t β prod.swap β»ΒΉ' r)
(comp : β r β B, β t β B, t β t β r) : uniform_space.core Ξ± :=
{ uniformity := B.filter,
refl := B.has_basis.ge_iff.mpr (Ξ» r ru, id_rel_subset.2 $ refl _ ru),
symm := (B.has_basis.tendsto_iff B.has_basis).mpr symm,
comp := (has_basis.le_basis_iff (B.has_basis.lift' (monotone_comp_rel monotone_id monotone_id))
B.has_basis).mpr comp }
/-- A uniform space generates a topological space -/
def uniform_space.core.to_topological_space {Ξ± : Type u} (u : uniform_space.core Ξ±) :
topological_space Ξ± :=
{ is_open := Ξ»s, βxβs, { p : Ξ± Γ Ξ± | p.1 = x β p.2 β s } β u.uniformity,
is_open_univ := by simp; intro; exact univ_mem,
is_open_inter :=
assume s t hs ht x β¨xs, xtβ©, by filter_upwards [hs x xs, ht x xt]; simp {contextual := tt},
is_open_sUnion :=
assume s hs x β¨t, ts, xtβ©, by filter_upwards [hs t ts x xt] with p ph h using β¨t, ts, ph hβ© }
lemma uniform_space.core_eq :
β{uβ uβ : uniform_space.core Ξ±}, uβ.uniformity = uβ.uniformity β uβ = uβ
| β¨uβ, _, _, _β© β¨uβ, _, _, _β© h := by { congr, exact h }
-- the topological structure is embedded in the uniform structure
-- to avoid instance diamond issues. See Note [forgetful inheritance].
/-- A uniform space is a generalization of the "uniform" topological aspects of a
metric space. It consists of a filter on `Ξ± Γ Ξ±` called the "uniformity", which
satisfies properties analogous to the reflexivity, symmetry, and triangle properties
of a metric.
A metric space has a natural uniformity, and a uniform space has a natural topology.
A topological group also has a natural uniformity, even when it is not metrizable. -/
class uniform_space (Ξ± : Type u) extends topological_space Ξ±, uniform_space.core Ξ± :=
(is_open_uniformity : βs, is_open s β (βxβs, { p : Ξ± Γ Ξ± | p.1 = x β p.2 β s } β uniformity))
/-- Alternative constructor for `uniform_space Ξ±` when a topology is already given. -/
@[pattern] def uniform_space.mk' {Ξ±} (t : topological_space Ξ±)
(c : uniform_space.core Ξ±)
(is_open_uniformity : βs:set Ξ±, t.is_open s β
(βxβs, { p : Ξ± Γ Ξ± | p.1 = x β p.2 β s } β c.uniformity)) :
uniform_space Ξ± := β¨c, is_open_uniformityβ©
/-- Construct a `uniform_space` from a `uniform_space.core`. -/
def uniform_space.of_core {Ξ± : Type u} (u : uniform_space.core Ξ±) : uniform_space Ξ± :=
{ to_core := u,
to_topological_space := u.to_topological_space,
is_open_uniformity := assume a, iff.rfl }
/-- Construct a `uniform_space` from a `u : uniform_space.core` and a `topological_space` structure
that is equal to `u.to_topological_space`. -/
def uniform_space.of_core_eq {Ξ± : Type u} (u : uniform_space.core Ξ±) (t : topological_space Ξ±)
(h : t = u.to_topological_space) : uniform_space Ξ± :=
{ to_core := u,
to_topological_space := t,
is_open_uniformity := assume a, h.symm βΈ iff.rfl }
lemma uniform_space.to_core_to_topological_space (u : uniform_space Ξ±) :
u.to_core.to_topological_space = u.to_topological_space :=
topological_space_eq $ funext $ assume s,
by rw [uniform_space.core.to_topological_space, uniform_space.is_open_uniformity]
@[ext]
lemma uniform_space_eq : β{uβ uβ : uniform_space Ξ±}, uβ.uniformity = uβ.uniformity β uβ = uβ
| (uniform_space.mk' tβ uβ oβ) (uniform_space.mk' tβ uβ oβ) h :=
have uβ = uβ, from uniform_space.core_eq h,
have tβ = tβ, from topological_space_eq $ funext $ assume s, by rw [oβ, oβ]; simp [this],
by simp [*]
lemma uniform_space.of_core_eq_to_core
(u : uniform_space Ξ±) (t : topological_space Ξ±) (h : t = u.to_core.to_topological_space) :
uniform_space.of_core_eq u.to_core t h = u :=
uniform_space_eq rfl
/-- Replace topology in a `uniform_space` instance with a propositionally (but possibly not
definitionally) equal one. -/
@[reducible] def uniform_space.replace_topology {Ξ± : Type*} [i : topological_space Ξ±]
(u : uniform_space Ξ±) (h : i = u.to_topological_space) : uniform_space Ξ± :=
uniform_space.of_core_eq u.to_core i $ h.trans u.to_core_to_topological_space.symm
lemma uniform_space.replace_topology_eq {Ξ± : Type*} [i : topological_space Ξ±] (u : uniform_space Ξ±)
(h : i = u.to_topological_space) : u.replace_topology h = u :=
u.of_core_eq_to_core _ _
section uniform_space
variables [uniform_space Ξ±]
/-- The uniformity is a filter on Ξ± Γ Ξ± (inferred from an ambient uniform space
structure on Ξ±). -/
def uniformity (Ξ± : Type u) [uniform_space Ξ±] : filter (Ξ± Γ Ξ±) :=
(@uniform_space.to_core Ξ± _).uniformity
localized "notation `π€` := uniformity" in uniformity
lemma is_open_uniformity {s : set Ξ±} :
is_open s β (βxβs, { p : Ξ± Γ Ξ± | p.1 = x β p.2 β s } β π€ Ξ±) :=
uniform_space.is_open_uniformity s
lemma refl_le_uniformity : π id_rel β€ π€ Ξ± :=
(@uniform_space.to_core Ξ± _).refl
instance uniformity.ne_bot [nonempty Ξ±] : ne_bot (π€ Ξ±) :=
begin
inhabit Ξ±,
refine (principal_ne_bot_iff.2 _).mono refl_le_uniformity,
exact β¨(default, default), rflβ©
end
lemma refl_mem_uniformity {x : Ξ±} {s : set (Ξ± Γ Ξ±)} (h : s β π€ Ξ±) :
(x, x) β s :=
refl_le_uniformity h rfl
lemma mem_uniformity_of_eq {x y : Ξ±} {s : set (Ξ± Γ Ξ±)} (h : s β π€ Ξ±) (hx : x = y) :
(x, y) β s :=
hx βΈ refl_mem_uniformity h
lemma symm_le_uniformity : map (@prod.swap Ξ± Ξ±) (π€ _) β€ (π€ _) :=
(@uniform_space.to_core Ξ± _).symm
lemma comp_le_uniformity : (π€ Ξ±).lift' (Ξ»s:set (Ξ±ΓΞ±), s β s) β€ π€ Ξ± :=
(@uniform_space.to_core Ξ± _).comp
lemma tendsto_swap_uniformity : tendsto (@prod.swap Ξ± Ξ±) (π€ Ξ±) (π€ Ξ±) :=
symm_le_uniformity
lemma comp_mem_uniformity_sets {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
β t β π€ Ξ±, t β t β s :=
have s β (π€ Ξ±).lift' (Ξ»t:set (Ξ±ΓΞ±), t β t),
from comp_le_uniformity hs,
(mem_lift'_sets $ monotone_comp_rel monotone_id monotone_id).mp this
/-- If `s β π€ Ξ±`, then for any natural `n`, for a subset `t` of a sufficiently small set in `π€ Ξ±`,
we have `t β t β ... β t β s` (`n` compositions). -/
lemma eventually_uniformity_iterate_comp_subset {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) (n : β) :
βαΆ t in (π€ Ξ±).small_sets, ((β) t) ^[n] t β s :=
begin
suffices : βαΆ t in (π€ Ξ±).small_sets, t β s β§ (((β) t) ^[n] t β s),
from (eventually_and.1 this).2,
induction n with n ihn generalizing s, { simpa },
rcases comp_mem_uniformity_sets hs with β¨t, htU, htsβ©,
refine (ihn htU).mono (Ξ» U hU, _),
rw [function.iterate_succ_apply'],
exact β¨hU.1.trans $ (subset_comp_self $ refl_le_uniformity htU).trans hts,
(comp_rel_mono hU.1 hU.2).trans htsβ©
end
/-- If `s β π€ Ξ±`, then for any natural `n`, for a subset `t` of a sufficiently small set in `π€ Ξ±`,
we have `t β t β s`. -/
lemma eventually_uniformity_comp_subset {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
βαΆ t in (π€ Ξ±).small_sets, t β t β s :=
eventually_uniformity_iterate_comp_subset hs 1
/-- Relation `Ξ» f g, tendsto (Ξ» x, (f x, g x)) l (π€ Ξ±)` is transitive. -/
lemma filter.tendsto.uniformity_trans {l : filter Ξ²} {fβ fβ fβ : Ξ² β Ξ±}
(hββ : tendsto (Ξ» x, (fβ x, fβ x)) l (π€ Ξ±)) (hββ : tendsto (Ξ» x, (fβ x, fβ x)) l (π€ Ξ±)) :
tendsto (Ξ» x, (fβ x, fβ x)) l (π€ Ξ±) :=
begin
refine le_trans (le_lift' $ Ξ» s hs, mem_map.2 _) comp_le_uniformity,
filter_upwards [hββ hs, hββ hs] with x hxββ hxββ using β¨_, hxββ, hxβββ©,
end
/-- Relation `Ξ» f g, tendsto (Ξ» x, (f x, g x)) l (π€ Ξ±)` is symmetric -/
lemma filter.tendsto.uniformity_symm {l : filter Ξ²} {f : Ξ² β Ξ± Γ Ξ±}
(h : tendsto f l (π€ Ξ±)) :
tendsto (Ξ» x, ((f x).2, (f x).1)) l (π€ Ξ±) :=
tendsto_swap_uniformity.comp h
/-- Relation `Ξ» f g, tendsto (Ξ» x, (f x, g x)) l (π€ Ξ±)` is reflexive. -/
lemma tendsto_diag_uniformity (f : Ξ² β Ξ±) (l : filter Ξ²) :
tendsto (Ξ» x, (f x, f x)) l (π€ Ξ±) :=
assume s hs, mem_map.2 $ univ_mem' $ Ξ» x, refl_mem_uniformity hs
lemma tendsto_const_uniformity {a : Ξ±} {f : filter Ξ²} : tendsto (Ξ» _, (a, a)) f (π€ Ξ±) :=
tendsto_diag_uniformity (Ξ» _, a) f
lemma symm_of_uniformity {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
β t β π€ Ξ±, (βa b, (a, b) β t β (b, a) β t) β§ t β s :=
have preimage prod.swap s β π€ Ξ±, from symm_le_uniformity hs,
β¨s β© preimage prod.swap s, inter_mem hs this, Ξ» a b β¨hβ, hββ©, β¨hβ, hββ©, inter_subset_left _ _β©
lemma comp_symm_of_uniformity {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
β t β π€ Ξ±, (β{a b}, (a, b) β t β (b, a) β t) β§ t β t β s :=
let β¨t, htβ, htββ© := comp_mem_uniformity_sets hs in
let β¨t', ht', ht'β, ht'ββ© := symm_of_uniformity htβ in
β¨t', ht', ht'β, subset.trans (monotone_comp_rel monotone_id monotone_id ht'β) htββ©
lemma uniformity_le_symm : π€ Ξ± β€ (@prod.swap Ξ± Ξ±) <$> π€ Ξ± :=
by rw [map_swap_eq_comap_swap];
from map_le_iff_le_comap.1 tendsto_swap_uniformity
lemma uniformity_eq_symm : π€ Ξ± = (@prod.swap Ξ± Ξ±) <$> π€ Ξ± :=
le_antisymm uniformity_le_symm symm_le_uniformity
@[simp] lemma comap_swap_uniformity : comap (@prod.swap Ξ± Ξ±) (π€ Ξ±) = π€ Ξ± :=
(congr_arg _ uniformity_eq_symm).trans $ comap_map prod.swap_injective
lemma symmetrize_mem_uniformity {V : set (Ξ± Γ Ξ±)} (h : V β π€ Ξ±) : symmetrize_rel V β π€ Ξ± :=
begin
apply (π€ Ξ±).inter_sets h,
rw [β image_swap_eq_preimage_swap, uniformity_eq_symm],
exact image_mem_map h,
end
theorem uniformity_lift_le_swap {g : set (Ξ±ΓΞ±) β filter Ξ²} {f : filter Ξ²} (hg : monotone g)
(h : (π€ Ξ±).lift (Ξ»s, g (preimage prod.swap s)) β€ f) : (π€ Ξ±).lift g β€ f :=
calc (π€ Ξ±).lift g β€ (filter.map (@prod.swap Ξ± Ξ±) $ π€ Ξ±).lift g :
lift_mono uniformity_le_symm le_rfl
... β€ _ :
by rw [map_lift_eq2 hg, image_swap_eq_preimage_swap]; exact h
lemma uniformity_lift_le_comp {f : set (Ξ±ΓΞ±) β filter Ξ²} (h : monotone f) :
(π€ Ξ±).lift (Ξ»s, f (s β s)) β€ (π€ Ξ±).lift f :=
calc (π€ Ξ±).lift (Ξ»s, f (s β s)) =
((π€ Ξ±).lift' (Ξ»s:set (Ξ±ΓΞ±), s β s)).lift f :
begin
rw [lift_lift'_assoc],
exact monotone_comp_rel monotone_id monotone_id,
exact h
end
... β€ (π€ Ξ±).lift f : lift_mono comp_le_uniformity le_rfl
lemma comp_le_uniformity3 :
(π€ Ξ±).lift' (Ξ»s:set (Ξ±ΓΞ±), s β (s β s)) β€ (π€ Ξ±) :=
calc (π€ Ξ±).lift' (Ξ»d, d β (d β d)) =
(π€ Ξ±).lift (Ξ»s, (π€ Ξ±).lift' (Ξ»t:set(Ξ±ΓΞ±), s β (t β t))) :
begin
rw [lift_lift'_same_eq_lift'],
exact (assume x, monotone_comp_rel monotone_const $ monotone_comp_rel monotone_id monotone_id),
exact (assume x, monotone_comp_rel monotone_id monotone_const),
end
... β€ (π€ Ξ±).lift (Ξ»s, (π€ Ξ±).lift' (Ξ»t:set(Ξ±ΓΞ±), s β t)) :
lift_mono' $ assume s hs, @uniformity_lift_le_comp Ξ± _ _ (π β (β) s) $
monotone_principal.comp (monotone_comp_rel monotone_const monotone_id)
... = (π€ Ξ±).lift' (Ξ»s:set(Ξ±ΓΞ±), s β s) :
lift_lift'_same_eq_lift'
(assume s, monotone_comp_rel monotone_const monotone_id)
(assume s, monotone_comp_rel monotone_id monotone_const)
... β€ (π€ Ξ±) : comp_le_uniformity
/-- See also `comp_open_symm_mem_uniformity_sets`. -/
lemma comp_symm_mem_uniformity_sets {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
β t β π€ Ξ±, symmetric_rel t β§ t β t β s :=
begin
obtain β¨w, w_in, w_subβ© : β w β π€ Ξ±, w β w β s := comp_mem_uniformity_sets hs,
use [symmetrize_rel w, symmetrize_mem_uniformity w_in, symmetric_symmetrize_rel w],
have : symmetrize_rel w β w := symmetrize_rel_subset_self w,
calc symmetrize_rel w β symmetrize_rel w β w β w : by mono
... β s : w_sub,
end
lemma subset_comp_self_of_mem_uniformity {s : set (Ξ± Γ Ξ±)} (h : s β π€ Ξ±) : s β s β s :=
subset_comp_self (refl_le_uniformity h)
lemma comp_comp_symm_mem_uniformity_sets {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
β t β π€ Ξ±, symmetric_rel t β§ t β t β t β s :=
begin
rcases comp_symm_mem_uniformity_sets hs with β¨w, w_in, w_symm, w_subβ©,
rcases comp_symm_mem_uniformity_sets w_in with β¨t, t_in, t_symm, t_subβ©,
use [t, t_in, t_symm],
have : t β t β t := subset_comp_self_of_mem_uniformity t_in,
calc
t β t β t β w β t : by mono
... β w β (t β t) : by mono
... β w β w : by mono
... β s : w_sub,
end
/-!
###Β Balls in uniform spaces
-/
/-- The ball around `(x : Ξ²)` with respect to `(V : set (Ξ² Γ Ξ²))`. Intended to be
used for `V β π€ Ξ²`, but this is not needed for the definition. Recovers the
notions of metric space ball when `V = {p | dist p.1 p.2 < r }`. -/
def uniform_space.ball (x : Ξ²) (V : set (Ξ² Γ Ξ²)) : set Ξ² := (prod.mk x) β»ΒΉ' V
open uniform_space (ball)
lemma uniform_space.mem_ball_self (x : Ξ±) {V : set (Ξ± Γ Ξ±)} (hV : V β π€ Ξ±) :
x β ball x V :=
refl_mem_uniformity hV
/-- The triangle inequality for `uniform_space.ball` -/
lemma mem_ball_comp {V W : set (Ξ² Γ Ξ²)} {x y z} (h : y β ball x V) (h' : z β ball y W) :
z β ball x (V β W) :=
prod_mk_mem_comp_rel h h'
lemma ball_subset_of_comp_subset {V W : set (Ξ² Γ Ξ²)} {x y} (h : x β ball y W) (h' : W β W β V) :
ball x W β ball y V :=
Ξ» z z_in, h' (mem_ball_comp h z_in)
lemma ball_mono {V W : set (Ξ² Γ Ξ²)} (h : V β W) (x : Ξ²) : ball x V β ball x W :=
by tauto
lemma ball_inter_left (x : Ξ²) (V W : set (Ξ² Γ Ξ²)) : ball x (V β© W) β ball x V :=
ball_mono (inter_subset_left V W) x
lemma ball_inter_right (x : Ξ²) (V W : set (Ξ² Γ Ξ²)) : ball x (V β© W) β ball x W :=
ball_mono (inter_subset_right V W) x
lemma mem_ball_symmetry {V : set (Ξ² Γ Ξ²)} (hV : symmetric_rel V) {x y} :
x β ball y V β y β ball x V :=
show (x, y) β prod.swap β»ΒΉ' V β (x, y) β V, by { unfold symmetric_rel at hV, rw hV }
lemma ball_eq_of_symmetry {V : set (Ξ² Γ Ξ²)} (hV : symmetric_rel V) {x} :
ball x V = {y | (y, x) β V} :=
by { ext y, rw mem_ball_symmetry hV, exact iff.rfl }
lemma mem_comp_of_mem_ball {V W : set (Ξ² Γ Ξ²)} {x y z : Ξ²} (hV : symmetric_rel V)
(hx : x β ball z V) (hy : y β ball z W) : (x, y) β V β W :=
begin
rw mem_ball_symmetry hV at hx,
exact β¨z, hx, hyβ©
end
lemma uniform_space.is_open_ball (x : Ξ±) {V : set (Ξ± Γ Ξ±)} (hV : is_open V) :
is_open (ball x V) :=
hV.preimage $ continuous_const.prod_mk continuous_id
lemma mem_comp_comp {V W M : set (Ξ² Γ Ξ²)} (hW' : symmetric_rel W) {p : Ξ² Γ Ξ²} :
p β V β M β W β ((ball p.1 V ΓΛ’ ball p.2 W) β© M).nonempty :=
begin
cases p with x y,
split,
{ rintros β¨z, β¨w, hpw, hwzβ©, hzyβ©,
exact β¨(w, z), β¨hpw, by rwa mem_ball_symmetry hW'β©, hwzβ©, },
{ rintro β¨β¨w, zβ©, β¨w_in, z_inβ©, hwzβ©,
rwa mem_ball_symmetry hW' at z_in,
use [z, w] ; tauto },
end
/-!
### Neighborhoods in uniform spaces
-/
lemma mem_nhds_uniformity_iff_right {x : Ξ±} {s : set Ξ±} :
s β π x β {p : Ξ± Γ Ξ± | p.1 = x β p.2 β s} β π€ Ξ± :=
begin
refine β¨_, Ξ» hs, _β©,
{ simp only [mem_nhds_iff, is_open_uniformity, and_imp, exists_imp_distrib],
intros t ts ht xt,
filter_upwards [ht x xt] using Ξ» y h eq, ts (h eq) },
{ refine mem_nhds_iff.mpr β¨{x | {p : Ξ± Γ Ξ± | p.1 = x β p.2 β s} β π€ Ξ±}, _, _, hsβ©,
{ exact Ξ» y hy, refl_mem_uniformity hy rfl },
{ refine is_open_uniformity.mpr (Ξ» y hy, _),
rcases comp_mem_uniformity_sets hy with β¨t, ht, trβ©,
filter_upwards [ht], rintro β¨a, bβ© hp' rfl,
filter_upwards [ht], rintro β¨a', b'β© hp'' rfl,
exact @tr (a, b') β¨a', hp', hp''β© rfl } }
end
lemma mem_nhds_uniformity_iff_left {x : Ξ±} {s : set Ξ±} :
s β π x β {p : Ξ± Γ Ξ± | p.2 = x β p.1 β s} β π€ Ξ± :=
by { rw [uniformity_eq_symm, mem_nhds_uniformity_iff_right], refl }
lemma nhds_eq_comap_uniformity_aux {Ξ± : Type u} {x : Ξ±} {s : set Ξ±} {F : filter (Ξ± Γ Ξ±)} :
{p : Ξ± Γ Ξ± | p.fst = x β p.snd β s} β F β s β comap (prod.mk x) F :=
by rw mem_comap ; from iff.intro
(assume hs, β¨_, hs, assume x hx, hx rflβ©)
(assume β¨t, h, htβ©, F.sets_of_superset h $
assume β¨pβ, pββ© hp (h : pβ = x), ht $ by simp [h.symm, hp])
lemma nhds_eq_comap_uniformity {x : Ξ±} : π x = (π€ Ξ±).comap (prod.mk x) :=
by { ext s, rw [mem_nhds_uniformity_iff_right], exact nhds_eq_comap_uniformity_aux }
/-- See also `is_open_iff_open_ball_subset`. -/
lemma is_open_iff_ball_subset {s : set Ξ±} : is_open s β β x β s, β V β π€ Ξ±, ball x V β s :=
begin
simp_rw [is_open_iff_mem_nhds, nhds_eq_comap_uniformity],
exact iff.rfl,
end
lemma nhds_basis_uniformity' {p : ΞΉ β Prop} {s : ΞΉ β set (Ξ± Γ Ξ±)} (h : (π€ Ξ±).has_basis p s)
{x : Ξ±} :
(π x).has_basis p (Ξ» i, ball x (s i)) :=
by { rw [nhds_eq_comap_uniformity], exact h.comap (prod.mk x) }
lemma nhds_basis_uniformity {p : ΞΉ β Prop} {s : ΞΉ β set (Ξ± Γ Ξ±)} (h : (π€ Ξ±).has_basis p s) {x : Ξ±} :
(π x).has_basis p (Ξ» i, {y | (y, x) β s i}) :=
begin
replace h := h.comap prod.swap,
rw [β map_swap_eq_comap_swap, β uniformity_eq_symm] at h,
exact nhds_basis_uniformity' h
end
lemma uniform_space.mem_nhds_iff {x : Ξ±} {s : set Ξ±} : s β π x β β V β π€ Ξ±, ball x V β s :=
begin
rw [nhds_eq_comap_uniformity, mem_comap],
exact iff.rfl,
end
lemma uniform_space.ball_mem_nhds (x : Ξ±) β¦V : set (Ξ± Γ Ξ±)β¦ (V_in : V β π€ Ξ±) : ball x V β π x :=
begin
rw uniform_space.mem_nhds_iff,
exact β¨V, V_in, subset.refl _β©
end
lemma uniform_space.mem_nhds_iff_symm {x : Ξ±} {s : set Ξ±} :
s β π x β β V β π€ Ξ±, symmetric_rel V β§ ball x V β s :=
begin
rw uniform_space.mem_nhds_iff,
split,
{ rintros β¨V, V_in, V_subβ©,
use [symmetrize_rel V, symmetrize_mem_uniformity V_in, symmetric_symmetrize_rel V],
exact subset.trans (ball_mono (symmetrize_rel_subset_self V) x) V_sub },
{ rintros β¨V, V_in, V_symm, V_subβ©,
exact β¨V, V_in, V_subβ© }
end
lemma uniform_space.has_basis_nhds (x : Ξ±) :
has_basis (π x) (Ξ» s : set (Ξ± Γ Ξ±), s β π€ Ξ± β§ symmetric_rel s) (Ξ» s, ball x s) :=
β¨Ξ» t, by simp [uniform_space.mem_nhds_iff_symm, and_assoc]β©
open uniform_space
lemma uniform_space.mem_closure_iff_symm_ball {s : set Ξ±} {x} :
x β closure s β β {V}, V β π€ Ξ± β symmetric_rel V β (s β© ball x V).nonempty :=
by simp [mem_closure_iff_nhds_basis (has_basis_nhds x), set.nonempty]
lemma uniform_space.mem_closure_iff_ball {s : set Ξ±} {x} :
x β closure s β β {V}, V β π€ Ξ± β (ball x V β© s).nonempty :=
by simp [mem_closure_iff_nhds_basis' (nhds_basis_uniformity' (π€ Ξ±).basis_sets)]
lemma uniform_space.has_basis_nhds_prod (x y : Ξ±) :
has_basis (π (x, y)) (Ξ» s, s β π€ Ξ± β§ symmetric_rel s) $ Ξ» s, ball x s ΓΛ’ ball y s :=
begin
rw nhds_prod_eq,
apply (has_basis_nhds x).prod' (has_basis_nhds y),
rintro U V β¨U_in, U_symmβ© β¨V_in, V_symmβ©,
exact β¨U β© V, β¨(π€ Ξ±).inter_sets U_in V_in, symmetric_rel_inter U_symm V_symmβ©,
ball_inter_left x U V, ball_inter_right y U Vβ©,
end
lemma nhds_eq_uniformity {x : Ξ±} : π x = (π€ Ξ±).lift' (ball x) :=
(nhds_basis_uniformity' (π€ Ξ±).basis_sets).eq_binfi
lemma mem_nhds_left (x : Ξ±) {s : set (Ξ±ΓΞ±)} (h : s β π€ Ξ±) :
{y : Ξ± | (x, y) β s} β π x :=
ball_mem_nhds x h
lemma mem_nhds_right (y : Ξ±) {s : set (Ξ±ΓΞ±)} (h : s β π€ Ξ±) :
{x : Ξ± | (x, y) β s} β π y :=
mem_nhds_left _ (symm_le_uniformity h)
lemma tendsto_right_nhds_uniformity {a : Ξ±} : tendsto (Ξ»a', (a', a)) (π a) (π€ Ξ±) :=
assume s, mem_nhds_right a
lemma tendsto_left_nhds_uniformity {a : Ξ±} : tendsto (Ξ»a', (a, a')) (π a) (π€ Ξ±) :=
assume s, mem_nhds_left a
lemma lift_nhds_left {x : Ξ±} {g : set Ξ± β filter Ξ²} (hg : monotone g) :
(π x).lift g = (π€ Ξ±).lift (Ξ»s:set (Ξ±ΓΞ±), g {y | (x, y) β s}) :=
eq.trans
begin
rw [nhds_eq_uniformity],
exact (filter.lift_assoc $ monotone_principal.comp $ monotone_preimage.comp monotone_preimage )
end
(congr_arg _ $ funext $ assume s, filter.lift_principal hg)
lemma lift_nhds_right {x : Ξ±} {g : set Ξ± β filter Ξ²} (hg : monotone g) :
(π x).lift g = (π€ Ξ±).lift (Ξ»s:set (Ξ±ΓΞ±), g {y | (y, x) β s}) :=
calc (π x).lift g = (π€ Ξ±).lift (Ξ»s:set (Ξ±ΓΞ±), g {y | (x, y) β s}) : lift_nhds_left hg
... = ((@prod.swap Ξ± Ξ±) <$> (π€ Ξ±)).lift (Ξ»s:set (Ξ±ΓΞ±), g {y | (x, y) β s}) :
by rw [βuniformity_eq_symm]
... = (π€ Ξ±).lift (Ξ»s:set (Ξ±ΓΞ±), g {y | (x, y) β image prod.swap s}) :
map_lift_eq2 $ hg.comp monotone_preimage
... = _ : by simp [image_swap_eq_preimage_swap]
lemma nhds_nhds_eq_uniformity_uniformity_prod {a b : Ξ±} :
π a ΓαΆ π b =
(π€ Ξ±).lift (Ξ»s:set (Ξ±ΓΞ±), (π€ Ξ±).lift' (Ξ»t:set (Ξ±ΓΞ±),
{y : Ξ± | (y, a) β s} ΓΛ’ {y : Ξ± | (b, y) β t})) :=
begin
rw [prod_def],
show (π a).lift (Ξ»s:set Ξ±, (π b).lift (Ξ»t:set Ξ±, π (s ΓΛ’ t))) = _,
rw [lift_nhds_right],
apply congr_arg, funext s,
rw [lift_nhds_left],
refl,
exact monotone_principal.comp (monotone_prod monotone_const monotone_id),
exact (monotone_lift' monotone_const $ monotone_lam $
assume x, monotone_prod monotone_id monotone_const)
end
lemma nhds_eq_uniformity_prod {a b : Ξ±} :
π (a, b) =
(π€ Ξ±).lift' (Ξ»s:set (Ξ±ΓΞ±), {y : Ξ± | (y, a) β s} ΓΛ’ {y : Ξ± | (b, y) β s}) :=
begin
rw [nhds_prod_eq, nhds_nhds_eq_uniformity_uniformity_prod, lift_lift'_same_eq_lift'],
{ intro s, exact monotone_prod monotone_const monotone_preimage },
{ intro t, exact monotone_prod monotone_preimage monotone_const }
end
lemma nhdset_of_mem_uniformity {d : set (Ξ±ΓΞ±)} (s : set (Ξ±ΓΞ±)) (hd : d β π€ Ξ±) :
β(t : set (Ξ±ΓΞ±)), is_open t β§ s β t β§ t β {p | βx y, (p.1, x) β d β§ (x, y) β s β§ (y, p.2) β d} :=
let cl_d := {p:Ξ±ΓΞ± | βx y, (p.1, x) β d β§ (x, y) β s β§ (y, p.2) β d} in
have βp β s, βt β cl_d, is_open t β§ p β t, from
assume β¨x, yβ© hp, _root_.mem_nhds_iff.mp $
show cl_d β π (x, y),
begin
rw [nhds_eq_uniformity_prod, mem_lift'_sets],
exact β¨d, hd, assume β¨a, bβ© β¨ha, hbβ©, β¨x, y, ha, hp, hbβ©β©,
exact monotone_prod monotone_preimage monotone_preimage
end,
have βt:(Ξ (p:Ξ±ΓΞ±) (h:p β s), set (Ξ±ΓΞ±)),
βp, βh:p β s, t p h β cl_d β§ is_open (t p h) β§ p β t p h,
by simp [classical.skolem] at this; simp; assumption,
match this with
| β¨t, htβ© :=
β¨(β p:Ξ±ΓΞ±, β h : p β s, t p h : set (Ξ±ΓΞ±)),
is_open_Union $ assume (p:Ξ±ΓΞ±), is_open_Union $ assume hp, (ht p hp).right.left,
assume β¨a, bβ© hp, begin simp; exact β¨a, b, hp, (ht (a,b) hp).right.rightβ© end,
Union_subset $ assume p, Union_subset $ assume hp, (ht p hp).leftβ©
end
/-- Entourages are neighborhoods of the diagonal. -/
lemma nhds_le_uniformity (x : Ξ±) : π (x, x) β€ π€ Ξ± :=
begin
intros V V_in,
rcases comp_symm_mem_uniformity_sets V_in with β¨w, w_in, w_symm, w_subβ©,
have : ball x w ΓΛ’ ball x w β π (x, x),
{ rw nhds_prod_eq,
exact prod_mem_prod (ball_mem_nhds x w_in) (ball_mem_nhds x w_in) },
apply mem_of_superset this,
rintros β¨u, vβ© β¨u_in, v_inβ©,
exact w_sub (mem_comp_of_mem_ball w_symm u_in v_in)
end
/-- Entourages are neighborhoods of the diagonal. -/
lemma supr_nhds_le_uniformity : (β¨ x : Ξ±, π (x, x)) β€ π€ Ξ± :=
supr_le nhds_le_uniformity
/-!
### Closure and interior in uniform spaces
-/
lemma closure_eq_uniformity (s : set $ Ξ± Γ Ξ±) :
closure s = β V β {V | V β π€ Ξ± β§ symmetric_rel V}, V β s β V :=
begin
ext β¨x, yβ©,
simp_rw [mem_closure_iff_nhds_basis (uniform_space.has_basis_nhds_prod x y),
mem_Inter, mem_set_of_eq],
refine forallβ_congr (Ξ» V, _),
rintros β¨V_in, V_symmβ©,
simp_rw [mem_comp_comp V_symm, inter_comm, exists_prop],
exact iff.rfl,
end
lemma uniformity_has_basis_closed : has_basis (π€ Ξ±) (Ξ» V : set (Ξ± Γ Ξ±), V β π€ Ξ± β§ is_closed V) id :=
begin
refine filter.has_basis_self.2 (Ξ» t h, _),
rcases comp_comp_symm_mem_uniformity_sets h with β¨w, w_in, w_symm, rβ©,
refine β¨closure w, mem_of_superset w_in subset_closure, is_closed_closure, _β©,
refine subset.trans _ r,
rw closure_eq_uniformity,
apply Inter_subset_of_subset,
apply Inter_subset,
exact β¨w_in, w_symmβ©
end
/-- Closed entourages form a basis of the uniformity filter. -/
lemma uniformity_has_basis_closure : has_basis (π€ Ξ±) (Ξ» V : set (Ξ± Γ Ξ±), V β π€ Ξ±) closure :=
β¨begin
intro t,
rw uniformity_has_basis_closed.mem_iff,
split,
{ rintros β¨r, β¨r_in, r_closedβ©, r_subβ©,
use [r, r_in],
convert r_sub,
rw r_closed.closure_eq,
refl },
{ rintros β¨r, r_in, r_subβ©,
exact β¨closure r, β¨mem_of_superset r_in subset_closure, is_closed_closureβ©, r_subβ© }
endβ©
lemma closure_eq_inter_uniformity {t : set (Ξ±ΓΞ±)} :
closure t = (β d β π€ Ξ±, d β (t β d)) :=
set.ext $ assume β¨a, bβ©,
calc (a, b) β closure t β (π (a, b) β π t β β₯) : mem_closure_iff_nhds_ne_bot
... β (((@prod.swap Ξ± Ξ±) <$> π€ Ξ±).lift'
(Ξ» (s : set (Ξ± Γ Ξ±)), {x : Ξ± | (x, a) β s} ΓΛ’ {y : Ξ± | (b, y) β s}) β π t β β₯) :
by rw [βuniformity_eq_symm, nhds_eq_uniformity_prod]
... β ((map (@prod.swap Ξ± Ξ±) (π€ Ξ±)).lift'
(Ξ» (s : set (Ξ± Γ Ξ±)), {x : Ξ± | (x, a) β s} ΓΛ’ {y : Ξ± | (b, y) β s}) β π t β β₯) :
by refl
... β ((π€ Ξ±).lift'
(Ξ» (s : set (Ξ± Γ Ξ±)), {y : Ξ± | (a, y) β s} ΓΛ’ {x : Ξ± | (x, b) β s}) β π t β β₯) :
begin
rw [map_lift'_eq2],
simp [image_swap_eq_preimage_swap, function.comp],
exact monotone_prod monotone_preimage monotone_preimage
end
... β (βs β π€ Ξ±, ({y : Ξ± | (a, y) β s} ΓΛ’ {x : Ξ± | (x, b) β s} β© t).nonempty) :
begin
rw [lift'_inf_principal_eq, β ne_bot_iff, lift'_ne_bot_iff],
exact (monotone_prod monotone_preimage monotone_preimage).inter monotone_const
end
... β (β s β π€ Ξ±, (a, b) β s β (t β s)) :
forallβ_congr $ Ξ» s hs,
β¨assume β¨β¨x, yβ©, β¨β¨hx, hyβ©, hxytβ©β©, β¨x, hx, y, hxyt, hyβ©,
assume β¨x, hx, y, hxyt, hyβ©, β¨β¨x, yβ©, β¨β¨hx, hyβ©, hxytβ©β©β©
... β _ : by simp
lemma uniformity_eq_uniformity_closure : π€ Ξ± = (π€ Ξ±).lift' closure :=
le_antisymm
(le_infi $ assume s, le_infi $ assume hs, by simp; filter_upwards [hs] using subset_closure)
(calc (π€ Ξ±).lift' closure β€ (π€ Ξ±).lift' (Ξ»d, d β (d β d)) :
lift'_mono' (by intros s hs; rw [closure_eq_inter_uniformity]; exact bInter_subset_of_mem hs)
... β€ (π€ Ξ±) : comp_le_uniformity3)
lemma uniformity_eq_uniformity_interior : π€ Ξ± = (π€ Ξ±).lift' interior :=
le_antisymm
(le_infi $ assume d, le_infi $ assume hd,
let β¨s, hs, hs_compβ© := (mem_lift'_sets $
monotone_comp_rel monotone_id $ monotone_comp_rel monotone_id monotone_id).mp
(comp_le_uniformity3 hd) in
let β¨t, ht, hst, ht_compβ© := nhdset_of_mem_uniformity s hs in
have s β interior d, from
calc s β t : hst
... β interior d : (subset_interior_iff_subset_of_open ht).mpr $
Ξ» x (hx : x β t), let β¨x, y, hβ, hβ, hββ© := ht_comp hx in hs_comp β¨x, hβ, y, hβ, hββ©,
have interior d β π€ Ξ±, by filter_upwards [hs] using this,
by simp [this])
(assume s hs, ((π€ Ξ±).lift' interior).sets_of_superset (mem_lift' hs) interior_subset)
lemma interior_mem_uniformity {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
interior s β π€ Ξ± :=
by rw [uniformity_eq_uniformity_interior]; exact mem_lift' hs
lemma mem_uniformity_is_closed {s : set (Ξ±ΓΞ±)} (h : s β π€ Ξ±) :
βt β π€ Ξ±, is_closed t β§ t β s :=
let β¨t, β¨ht_mem, htcβ©, htsβ© := uniformity_has_basis_closed.mem_iff.1 h in
β¨t, ht_mem, htc, htsβ©
lemma is_open_iff_open_ball_subset {s : set Ξ±} :
is_open s β β x β s, β V β π€ Ξ±, is_open V β§ ball x V β s :=
begin
rw is_open_iff_ball_subset,
split; intros h x hx,
{ obtain β¨V, hV, hV'β© := h x hx,
exact β¨interior V, interior_mem_uniformity hV, is_open_interior,
(ball_mono interior_subset x).trans hV'β©, },
{ obtain β¨V, hV, -, hV'β© := h x hx,
exact β¨V, hV, hV'β©, },
end
/-- The uniform neighborhoods of all points of a dense set cover the whole space. -/
lemma dense.bUnion_uniformity_ball {s : set Ξ±} {U : set (Ξ± Γ Ξ±)} (hs : dense s) (hU : U β π€ Ξ±) :
(β x β s, ball x U) = univ :=
begin
refine Unionβ_eq_univ_iff.2 (Ξ» y, _),
rcases hs.inter_nhds_nonempty (mem_nhds_right y hU) with β¨x, hxs, hxy : (x, y) β Uβ©,
exact β¨x, hxs, hxyβ©
end
/-!
### Uniformity bases
-/
/-- Open elements of `π€ Ξ±` form a basis of `π€ Ξ±`. -/
lemma uniformity_has_basis_open : has_basis (π€ Ξ±) (Ξ» V : set (Ξ± Γ Ξ±), V β π€ Ξ± β§ is_open V) id :=
has_basis_self.2 $ Ξ» s hs,
β¨interior s, interior_mem_uniformity hs, is_open_interior, interior_subsetβ©
lemma filter.has_basis.mem_uniformity_iff {p : Ξ² β Prop} {s : Ξ² β set (Ξ±ΓΞ±)}
(h : (π€ Ξ±).has_basis p s) {t : set (Ξ± Γ Ξ±)} :
t β π€ Ξ± β β i (hi : p i), β a b, (a, b) β s i β (a, b) β t :=
h.mem_iff.trans $ by simp only [prod.forall, subset_def]
/-- Symmetric entourages form a basis of `π€ Ξ±` -/
lemma uniform_space.has_basis_symmetric :
(π€ Ξ±).has_basis (Ξ» s : set (Ξ± Γ Ξ±), s β π€ Ξ± β§ symmetric_rel s) id :=
has_basis_self.2 $ Ξ» t t_in, β¨symmetrize_rel t, symmetrize_mem_uniformity t_in,
symmetric_symmetrize_rel t, symmetrize_rel_subset_self tβ©
/-- Open elements `s : set (Ξ± Γ Ξ±)` of `π€ Ξ±` such that `(x, y) β s β (y, x) β s` form a basis
of `π€ Ξ±`. -/
lemma uniformity_has_basis_open_symmetric :
has_basis (π€ Ξ±) (Ξ» V : set (Ξ± Γ Ξ±), V β π€ Ξ± β§ is_open V β§ symmetric_rel V) id :=
begin
simp only [β and_assoc],
refine uniformity_has_basis_open.restrict (Ξ» s hs, β¨symmetrize_rel s, _β©),
exact β¨β¨symmetrize_mem_uniformity hs.1, is_open.inter hs.2 (hs.2.preimage continuous_swap)β©,
symmetric_symmetrize_rel s, symmetrize_rel_subset_self sβ©
end
lemma comp_open_symm_mem_uniformity_sets {s : set (Ξ± Γ Ξ±)} (hs : s β π€ Ξ±) :
β t β π€ Ξ±, is_open t β§ symmetric_rel t β§ t β t β s :=
begin
obtain β¨t, htβ, htββ© := comp_mem_uniformity_sets hs,
obtain β¨u, β¨huβ, huβ, huββ©, huβ : u β tβ© := uniformity_has_basis_open_symmetric.mem_iff.mp htβ,
exact β¨u, huβ, huβ, huβ, (comp_rel_mono huβ huβ).trans htββ©,
end
section
variable (Ξ±)
lemma uniform_space.has_seq_basis [is_countably_generated $ π€ Ξ±] :
β V : β β set (Ξ± Γ Ξ±), has_antitone_basis (π€ Ξ±) V β§ β n, symmetric_rel (V n) :=
let β¨U, hsym, hbasisβ© := uniform_space.has_basis_symmetric.exists_antitone_subbasis
in β¨U, hbasis, Ξ» n, (hsym n).2β©
end
lemma filter.has_basis.bInter_bUnion_ball {p : ΞΉ β Prop} {U : ΞΉ β set (Ξ± Γ Ξ±)}
(h : has_basis (π€ Ξ±) p U) (s : set Ξ±) :
(β i (hi : p i), β x β s, ball x (U i)) = closure s :=
begin
ext x,
simp [mem_closure_iff_nhds_basis (nhds_basis_uniformity h), ball]
end
/-! ### Uniform continuity -/
/-- A function `f : Ξ± β Ξ²` is *uniformly continuous* if `(f x, f y)` tends to the diagonal
as `(x, y)` tends to the diagonal. In other words, if `x` is sufficiently close to `y`, then
`f x` is close to `f y` no matter where `x` and `y` are located in `Ξ±`. -/
def uniform_continuous [uniform_space Ξ²] (f : Ξ± β Ξ²) :=
tendsto (Ξ»x:Ξ±ΓΞ±, (f x.1, f x.2)) (π€ Ξ±) (π€ Ξ²)
/-- A function `f : Ξ± β Ξ²` is *uniformly continuous* on `s : set Ξ±` if `(f x, f y)` tends to
the diagonal as `(x, y)` tends to the diagonal while remaining in `s ΓΛ’ s`.
In other words, if `x` is sufficiently close to `y`, then `f x` is close to
`f y` no matter where `x` and `y` are located in `s`.-/
def uniform_continuous_on [uniform_space Ξ²] (f : Ξ± β Ξ²) (s : set Ξ±) : Prop :=
tendsto (Ξ» x : Ξ± Γ Ξ±, (f x.1, f x.2)) (π€ Ξ± β principal (s ΓΛ’ s)) (π€ Ξ²)
theorem uniform_continuous_def [uniform_space Ξ²] {f : Ξ± β Ξ²} :
uniform_continuous f β β r β π€ Ξ², { x : Ξ± Γ Ξ± | (f x.1, f x.2) β r} β π€ Ξ± :=
iff.rfl
theorem uniform_continuous_iff_eventually [uniform_space Ξ²] {f : Ξ± β Ξ²} :
uniform_continuous f β β r β π€ Ξ², βαΆ (x : Ξ± Γ Ξ±) in π€ Ξ±, (f x.1, f x.2) β r :=
iff.rfl
theorem uniform_continuous_on_univ [uniform_space Ξ²] {f : Ξ± β Ξ²} :
uniform_continuous_on f univ β uniform_continuous f :=
by rw [uniform_continuous_on, uniform_continuous, univ_prod_univ, principal_univ, inf_top_eq]
lemma uniform_continuous_of_const [uniform_space Ξ²] {c : Ξ± β Ξ²} (h : βa b, c a = c b) :
uniform_continuous c :=
have (Ξ» (x : Ξ± Γ Ξ±), (c (x.fst), c (x.snd))) β»ΒΉ' id_rel = univ, from
eq_univ_iff_forall.2 $ assume β¨a, bβ©, h a b,
le_trans (map_le_iff_le_comap.2 $ by simp [comap_principal, this, univ_mem]) refl_le_uniformity
lemma uniform_continuous_id : uniform_continuous (@id Ξ±) :=
by simp [uniform_continuous]; exact tendsto_id
lemma uniform_continuous_const [uniform_space Ξ²] {b : Ξ²} : uniform_continuous (Ξ»a:Ξ±, b) :=
uniform_continuous_of_const $ Ξ» _ _, rfl
lemma uniform_continuous.comp [uniform_space Ξ²] [uniform_space Ξ³] {g : Ξ² β Ξ³} {f : Ξ± β Ξ²}
(hg : uniform_continuous g) (hf : uniform_continuous f) : uniform_continuous (g β f) :=
hg.comp hf
lemma filter.has_basis.uniform_continuous_iff [uniform_space Ξ²] {p : Ξ³ β Prop} {s : Ξ³ β set (Ξ±ΓΞ±)}
(ha : (π€ Ξ±).has_basis p s) {q : Ξ΄ β Prop} {t : Ξ΄ β set (Ξ²ΓΞ²)} (hb : (π€ Ξ²).has_basis q t)
{f : Ξ± β Ξ²} :
uniform_continuous f β β i (hi : q i), β j (hj : p j), β x y, (x, y) β s j β (f x, f y) β t i :=
(ha.tendsto_iff hb).trans $ by simp only [prod.forall]
lemma filter.has_basis.uniform_continuous_on_iff [uniform_space Ξ²] {p : Ξ³ β Prop}
{s : Ξ³ β set (Ξ±ΓΞ±)} (ha : (π€ Ξ±).has_basis p s) {q : Ξ΄ β Prop} {t : Ξ΄ β set (Ξ²ΓΞ²)}
(hb : (π€ Ξ²).has_basis q t) {f : Ξ± β Ξ²} {S : set Ξ±} :
uniform_continuous_on f S β
β i (hi : q i), β j (hj : p j), β x y β S, (x, y) β s j β (f x, f y) β t i :=
((ha.inf_principal (S ΓΛ’ S)).tendsto_iff hb).trans $
by simp [prod.forall, set.inter_comm (s _), ball_mem_comm]
end uniform_space
open_locale uniformity
section constructions
instance : partial_order (uniform_space Ξ±) :=
{ le := Ξ»t s, t.uniformity β€ s.uniformity,
le_antisymm := assume t s hβ hβ, uniform_space_eq $ le_antisymm hβ hβ,
le_refl := assume t, le_rfl,
le_trans := assume a b c hβ hβ, le_trans hβ hβ }
instance : has_Inf (uniform_space Ξ±) :=
β¨assume s, uniform_space.of_core
{ uniformity := (β¨
uβs, @uniformity Ξ± u),
refl := le_infi $ assume u, le_infi $ assume hu, u.refl,
symm := le_infi $ assume u, le_infi $ assume hu,
le_trans (map_mono $ infi_le_of_le _ $ infi_le _ hu) u.symm,
comp := le_infi $ assume u, le_infi $ assume hu,
le_trans (lift'_mono (infi_le_of_le _ $ infi_le _ hu) $ le_rfl) u.comp }β©
private lemma Inf_le {tt : set (uniform_space Ξ±)} {t : uniform_space Ξ±} (h : t β tt) :
Inf tt β€ t :=
show (β¨
uβtt, @uniformity Ξ± u) β€ t.uniformity,
from infi_le_of_le t $ infi_le _ h
private lemma le_Inf {tt : set (uniform_space Ξ±)} {t : uniform_space Ξ±} (h : βt'βtt, t β€ t') :
t β€ Inf tt :=
show t.uniformity β€ (β¨
uβtt, @uniformity Ξ± u),
from le_infi $ assume t', le_infi $ assume ht', h t' ht'
instance : has_top (uniform_space Ξ±) :=
β¨uniform_space.of_core { uniformity := β€, refl := le_top, symm := le_top, comp := le_top }β©
instance : has_bot (uniform_space Ξ±) :=
β¨{ to_topological_space := β₯,
uniformity := π id_rel,
refl := le_rfl,
symm := by simp [tendsto]; apply subset.refl,
comp :=
begin
rw [lift'_principal], {simp},
exact monotone_comp_rel monotone_id monotone_id
end,
is_open_uniformity :=
assume s, by simp [is_open_fold, subset_def, id_rel] {contextual := tt } } β©
instance : complete_lattice (uniform_space Ξ±) :=
{ sup := Ξ»a b, Inf {x | a β€ x β§ b β€ x},
le_sup_left := Ξ» a b, le_Inf (Ξ» _ β¨h, _β©, h),
le_sup_right := Ξ» a b, le_Inf (Ξ» _ β¨_, hβ©, h),
sup_le := Ξ» a b c hβ hβ, Inf_le β¨hβ, hββ©,
inf := Ξ» a b, Inf {a, b},
le_inf := Ξ» a b c hβ hβ, le_Inf (Ξ» u h,
by { cases h, exact h.symm βΈ hβ, exact (mem_singleton_iff.1 h).symm βΈ hβ }),
inf_le_left := Ξ» a b, Inf_le (by simp),
inf_le_right := Ξ» a b, Inf_le (by simp),
top := β€,
le_top := Ξ» a, show a.uniformity β€ β€, from le_top,
bot := β₯,
bot_le := Ξ» u, u.refl,
Sup := Ξ» tt, Inf {t | β t' β tt, t' β€ t},
le_Sup := Ξ» s u h, le_Inf (Ξ» u' h', h' u h),
Sup_le := Ξ» s u h, Inf_le h,
Inf := Inf,
le_Inf := Ξ» s a hs, le_Inf hs,
Inf_le := Ξ» s a ha, Inf_le ha,
..uniform_space.partial_order }
lemma infi_uniformity {ΞΉ : Sort*} {u : ΞΉ β uniform_space Ξ±} :
(infi u).uniformity = (β¨
i, (u i).uniformity) :=
show (β¨
a (h : βi:ΞΉ, u i = a), a.uniformity) = _, from
le_antisymm
(le_infi $ assume i, infi_le_of_le (u i) $ infi_le _ β¨i, rflβ©)
(le_infi $ assume a, le_infi $ assume β¨i, (ha : u i = a)β©, ha βΈ infi_le _ _)
lemma infi_uniformity' {ΞΉ : Sort*} {u : ΞΉ β uniform_space Ξ±} :
@uniformity Ξ± (infi u) = (β¨
i, @uniformity Ξ± (u i)) :=
infi_uniformity
lemma inf_uniformity {u v : uniform_space Ξ±} :
(u β v).uniformity = u.uniformity β v.uniformity :=
have (u β v) = (β¨
i (h : i = u β¨ i = v), i), by simp [infi_or, infi_inf_eq],
calc (u β v).uniformity = ((β¨
i (h : i = u β¨ i = v), i) : uniform_space Ξ±).uniformity : by rw [this]
... = _ : by simp [infi_uniformity, infi_or, infi_inf_eq]
lemma inf_uniformity' {u v : uniform_space Ξ±} :
@uniformity Ξ± (u β v) = @uniformity Ξ± u β @uniformity Ξ± v :=
inf_uniformity
instance inhabited_uniform_space : inhabited (uniform_space Ξ±) := β¨β₯β©
instance inhabited_uniform_space_core : inhabited (uniform_space.core Ξ±) :=
β¨@uniform_space.to_core _ defaultβ©
/-- Given `f : Ξ± β Ξ²` and a uniformity `u` on `Ξ²`, the inverse image of `u` under `f`
is the inverse image in the filter sense of the induced function `Ξ± Γ Ξ± β Ξ² Γ Ξ²`. -/
def uniform_space.comap (f : Ξ± β Ξ²) (u : uniform_space Ξ²) : uniform_space Ξ± :=
{ uniformity := u.uniformity.comap (Ξ»p:Ξ±ΓΞ±, (f p.1, f p.2)),
to_topological_space := u.to_topological_space.induced f,
refl := le_trans (by simp; exact assume β¨a, bβ© (h : a = b), h βΈ rfl) (comap_mono u.refl),
symm := by simp [tendsto_comap_iff, prod.swap, (β)];
exact tendsto_swap_uniformity.comp tendsto_comap,
comp := le_trans
begin
rw [comap_lift'_eq, comap_lift'_eq2],
exact (lift'_mono' $ assume s hs β¨aβ, aββ© β¨x, hβ, hββ©, β¨f x, hβ, hββ©),
exact monotone_comp_rel monotone_id monotone_id
end
(comap_mono u.comp),
is_open_uniformity := Ξ» s, begin
change (@is_open Ξ± (u.to_topological_space.induced f) s β _),
simp [is_open_iff_nhds, nhds_induced, mem_nhds_uniformity_iff_right, filter.comap, and_comm],
refine ball_congr (Ξ» x hx, β¨_, _β©),
{ rintro β¨t, hts, htβ©, refine β¨_, ht, _β©,
rintro β¨xβ, xββ© h rfl, exact hts (h rfl) },
{ rintro β¨t, ht, htsβ©,
exact β¨{y | (f x, y) β t}, Ξ» y hy, @hts (x, y) hy rfl,
mem_nhds_uniformity_iff_right.1 $ mem_nhds_left _ htβ© }
end }
lemma uniformity_comap [uniform_space Ξ±] [uniform_space Ξ²] {f : Ξ± β Ξ²}
(h : βΉuniform_space Ξ±βΊ = uniform_space.comap f βΉuniform_space Ξ²βΊ) :
π€ Ξ± = comap (prod.map f f) (π€ Ξ²) :=
by { rw h, refl }
lemma uniform_space_comap_id {Ξ± : Type*} : uniform_space.comap (id : Ξ± β Ξ±) = id :=
by ext u ; dsimp only [uniform_space.comap, id] ; rw [prod.id_prod, filter.comap_id]
lemma uniform_space.comap_comap {Ξ± Ξ² Ξ³} [uΞ³ : uniform_space Ξ³] {f : Ξ± β Ξ²} {g : Ξ² β Ξ³} :
uniform_space.comap (g β f) uΞ³ = uniform_space.comap f (uniform_space.comap g uΞ³) :=
by ext ; dsimp only [uniform_space.comap] ; rw filter.comap_comap
lemma uniform_space.comap_inf {Ξ± Ξ³} {uβ uβ : uniform_space Ξ³} {f : Ξ± β Ξ³} :
(uβ β uβ).comap f = uβ.comap f β uβ.comap f :=
begin
ext : 1,
change (π€ _) = (π€ _),
simp [uniformity_comap rfl, inf_uniformity'],
end
lemma uniform_space.comap_infi {ΞΉ Ξ± Ξ³} {u : ΞΉ β uniform_space Ξ³} {f : Ξ± β Ξ³} :
(β¨
i, u i).comap f = β¨
i, (u i).comap f :=
begin
ext : 1,
change (π€ _) = (π€ _),
simp [uniformity_comap rfl, infi_uniformity']
end
lemma uniform_space.comap_mono {Ξ± Ξ³} {f : Ξ± β Ξ³} :
monotone (Ξ» u : uniform_space Ξ³, u.comap f) :=
begin
intros uβ uβ hu,
change (π€ _) β€ (π€ _),
rw uniformity_comap rfl,
exact comap_mono hu
end
lemma uniform_continuous_iff {Ξ± Ξ²} [uΞ± : uniform_space Ξ±] [uΞ² : uniform_space Ξ²] {f : Ξ± β Ξ²} :
uniform_continuous f β uΞ± β€ uΞ².comap f :=
filter.map_le_iff_le_comap
lemma le_iff_uniform_continuous_id {u v : uniform_space Ξ±} :
u β€ v β @uniform_continuous _ _ u v id :=
by rw [uniform_continuous_iff, uniform_space_comap_id, id]
lemma uniform_continuous_comap {f : Ξ± β Ξ²} [u : uniform_space Ξ²] :
@uniform_continuous Ξ± Ξ² (uniform_space.comap f u) u f :=
tendsto_comap
theorem to_topological_space_comap {f : Ξ± β Ξ²} {u : uniform_space Ξ²} :
@uniform_space.to_topological_space _ (uniform_space.comap f u) =
topological_space.induced f (@uniform_space.to_topological_space Ξ² u) := rfl
lemma uniform_continuous_comap' {f : Ξ³ β Ξ²} {g : Ξ± β Ξ³} [v : uniform_space Ξ²] [u : uniform_space Ξ±]
(h : uniform_continuous (f β g)) : @uniform_continuous Ξ± Ξ³ u (uniform_space.comap f v) g :=
tendsto_comap_iff.2 h
lemma to_nhds_mono {uβ uβ : uniform_space Ξ±} (h : uβ β€ uβ) (a : Ξ±) :
@nhds _ (@uniform_space.to_topological_space _ uβ) a β€
@nhds _ (@uniform_space.to_topological_space _ uβ) a :=
by rw [@nhds_eq_uniformity Ξ± uβ a, @nhds_eq_uniformity Ξ± uβ a]; exact (lift'_mono h le_rfl)
lemma to_topological_space_mono {uβ uβ : uniform_space Ξ±} (h : uβ β€ uβ) :
@uniform_space.to_topological_space _ uβ β€ @uniform_space.to_topological_space _ uβ :=
le_of_nhds_le_nhds $ to_nhds_mono h
lemma uniform_continuous.continuous [uniform_space Ξ±] [uniform_space Ξ²] {f : Ξ± β Ξ²}
(hf : uniform_continuous f) : continuous f :=
continuous_iff_le_induced.mpr $ to_topological_space_mono $ uniform_continuous_iff.1 hf
lemma to_topological_space_bot : @uniform_space.to_topological_space Ξ± β₯ = β₯ := rfl
lemma to_topological_space_top : @uniform_space.to_topological_space Ξ± β€ = β€ :=
top_unique $ assume s hs, s.eq_empty_or_nonempty.elim
(assume : s = β
, this.symm βΈ @is_open_empty _ β€)
(assume β¨x, hxβ©,
have s = univ, from top_unique $ assume y hy, hs x hx (x, y) rfl,
this.symm βΈ @is_open_univ _ β€)
lemma to_topological_space_infi {ΞΉ : Sort*} {u : ΞΉ β uniform_space Ξ±} :
(infi u).to_topological_space = β¨
i, (u i).to_topological_space :=
begin
refine (eq_of_nhds_eq_nhds $ assume a, _),
rw [nhds_infi, nhds_eq_uniformity],
change (infi u).uniformity.lift' (preimage $ prod.mk a) = _,
rw [infi_uniformity, lift'_infi_of_map_univ _ preimage_univ],
{ simp only [nhds_eq_uniformity], refl },
{ exact Ξ» a b, preimage_inter }
end
lemma to_topological_space_Inf {s : set (uniform_space Ξ±)} :
(Inf s).to_topological_space = (β¨
iβs, @uniform_space.to_topological_space Ξ± i) :=
begin
rw [Inf_eq_infi],
simp only [β to_topological_space_infi],
end
lemma to_topological_space_inf {u v : uniform_space Ξ±} :
(u β v).to_topological_space = u.to_topological_space β v.to_topological_space :=
by rw [to_topological_space_Inf, infi_pair]
/-- A uniform space with the discrete uniformity has the discrete topology. -/
lemma discrete_topology_of_discrete_uniformity [hΞ± : uniform_space Ξ±]
(h : uniformity Ξ± = π id_rel) :
discrete_topology Ξ± :=
β¨(uniform_space_eq h.symm : β₯ = hΞ±) βΈ rflβ©
instance : uniform_space empty := β₯
instance : uniform_space punit := β₯
instance : uniform_space bool := β₯
instance : uniform_space β := β₯
instance : uniform_space β€ := β₯
instance {p : Ξ± β Prop} [t : uniform_space Ξ±] : uniform_space (subtype p) :=
uniform_space.comap subtype.val t
lemma uniformity_subtype {p : Ξ± β Prop} [t : uniform_space Ξ±] :
π€ (subtype p) = comap (Ξ»q:subtype p Γ subtype p, (q.1.1, q.2.1)) (π€ Ξ±) :=
rfl
lemma uniform_continuous_subtype_val {p : Ξ± β Prop} [uniform_space Ξ±] :
uniform_continuous (subtype.val : {a : Ξ± // p a} β Ξ±) :=
uniform_continuous_comap
lemma uniform_continuous_subtype_coe {p : Ξ± β Prop} [uniform_space Ξ±] :
uniform_continuous (coe : {a : Ξ± // p a} β Ξ±) :=
uniform_continuous_subtype_val
lemma uniform_continuous_subtype_mk {p : Ξ± β Prop} [uniform_space Ξ±] [uniform_space Ξ²]
{f : Ξ² β Ξ±} (hf : uniform_continuous f) (h : βx, p (f x)) :
uniform_continuous (Ξ»x, β¨f x, h xβ© : Ξ² β subtype p) :=
uniform_continuous_comap' hf
lemma uniform_continuous_on_iff_restrict [uniform_space Ξ±] [uniform_space Ξ²] {f : Ξ± β Ξ²}
{s : set Ξ±} :
uniform_continuous_on f s β uniform_continuous (s.restrict f) :=
begin
unfold uniform_continuous_on set.restrict uniform_continuous tendsto,
rw [show (Ξ» x : s Γ s, (f x.1, f x.2)) = prod.map f f β coe, by ext x; cases x; refl,
uniformity_comap rfl,
show prod.map subtype.val subtype.val = (coe : s Γ s β Ξ± Γ Ξ±), by ext x; cases x; refl],
conv in (map _ (comap _ _)) { rw β filter.map_map },
rw subtype_coe_map_comap_prod, refl,
end
lemma tendsto_of_uniform_continuous_subtype
[uniform_space Ξ±] [uniform_space Ξ²] {f : Ξ± β Ξ²} {s : set Ξ±} {a : Ξ±}
(hf : uniform_continuous (Ξ»x:s, f x.val)) (ha : s β π a) :
tendsto f (π a) (π (f a)) :=
by rw [(@map_nhds_subtype_coe_eq Ξ± _ s a (mem_of_mem_nhds ha) ha).symm]; exact
tendsto_map' (continuous_iff_continuous_at.mp hf.continuous _)
lemma uniform_continuous_on.continuous_on [uniform_space Ξ±] [uniform_space Ξ²] {f : Ξ± β Ξ²}
{s : set Ξ±} (h : uniform_continuous_on f s) : continuous_on f s :=
begin
rw uniform_continuous_on_iff_restrict at h,
rw continuous_on_iff_continuous_restrict,
exact h.continuous
end
@[to_additive]
instance [uniform_space Ξ±] : uniform_space (Ξ±α΅α΅α΅) :=
uniform_space.comap mul_opposite.unop βΉ_βΊ
@[to_additive]
lemma uniformity_mul_opposite [uniform_space Ξ±] :
π€ (Ξ±α΅α΅α΅) = comap (Ξ» q : Ξ±α΅α΅α΅ Γ Ξ±α΅α΅α΅, (q.1.unop, q.2.unop)) (π€ Ξ±) :=
rfl
@[simp, to_additive] lemma comap_uniformity_mul_opposite [uniform_space Ξ±] :
comap (Ξ» p : Ξ± Γ Ξ±, (mul_opposite.op p.1, mul_opposite.op p.2)) (π€ Ξ±α΅α΅α΅) = π€ Ξ± :=
by simpa [uniformity_mul_opposite, comap_comap, (β)] using comap_id
namespace mul_opposite
@[to_additive]
lemma uniform_continuous_unop [uniform_space Ξ±] : uniform_continuous (unop : Ξ±α΅α΅α΅ β Ξ±) :=
uniform_continuous_comap
@[to_additive]
lemma uniform_continuous_op [uniform_space Ξ±] : uniform_continuous (op : Ξ± β Ξ±α΅α΅α΅) :=
uniform_continuous_comap' uniform_continuous_id
end mul_opposite
section prod
/- a similar product space is possible on the function space (uniformity of pointwise convergence),
but we want to have the uniformity of uniform convergence on function spaces -/
instance [uβ : uniform_space Ξ±] [uβ : uniform_space Ξ²] : uniform_space (Ξ± Γ Ξ²) :=
uniform_space.of_core_eq
(uβ.comap prod.fst β uβ.comap prod.snd).to_core
prod.topological_space
(calc prod.topological_space = (uβ.comap prod.fst β uβ.comap prod.snd).to_topological_space :
by rw [to_topological_space_inf, to_topological_space_comap, to_topological_space_comap]; refl
... = _ : by rw [uniform_space.to_core_to_topological_space])
theorem uniformity_prod [uniform_space Ξ±] [uniform_space Ξ²] : π€ (Ξ± Γ Ξ²) =
(π€ Ξ±).comap (Ξ»p:(Ξ± Γ Ξ²) Γ Ξ± Γ Ξ², (p.1.1, p.2.1)) β
(π€ Ξ²).comap (Ξ»p:(Ξ± Γ Ξ²) Γ Ξ± Γ Ξ², (p.1.2, p.2.2)) :=
inf_uniformity
lemma uniformity_prod_eq_prod [uniform_space Ξ±] [uniform_space Ξ²] :
π€ (Ξ± Γ Ξ²) = map (Ξ» p : (Ξ± Γ Ξ±) Γ (Ξ² Γ Ξ²), ((p.1.1, p.2.1), (p.1.2, p.2.2))) (π€ Ξ± ΓαΆ π€ Ξ²) :=
by rw [map_swap4_eq_comap, uniformity_prod, filter.prod, comap_inf, comap_comap, comap_comap]
lemma mem_map_iff_exists_image' {Ξ± : Type*} {Ξ² : Type*} {f : filter Ξ±} {m : Ξ± β Ξ²} {t : set Ξ²} :
t β (map m f).sets β (βsβf, m '' s β t) :=
mem_map_iff_exists_image
lemma mem_uniformity_of_uniform_continuous_invariant [uniform_space Ξ±] {s:set (Ξ±ΓΞ±)} {f : Ξ± β Ξ± β Ξ±}
(hf : uniform_continuous (Ξ»p:Ξ±ΓΞ±, f p.1 p.2)) (hs : s β π€ Ξ±) :
βuβπ€ Ξ±, βa b c, (a, b) β u β (f a c, f b c) β s :=
begin
rw [uniform_continuous, uniformity_prod_eq_prod, tendsto_map'_iff, (β)] at hf,
rcases mem_map_iff_exists_image'.1 (hf hs) with β¨t, ht, htsβ©, clear hf,
rcases mem_prod_iff.1 ht with β¨u, hu, v, hv, huvtβ©, clear ht,
refine β¨u, hu, assume a b c hab, hts $ (mem_image _ _ _).2 β¨β¨β¨a, bβ©, β¨c, cβ©β©, huvt β¨_, _β©, _β©β©,
exact hab,
exact refl_mem_uniformity hv,
refl
end
lemma mem_uniform_prod [tβ : uniform_space Ξ±] [tβ : uniform_space Ξ²] {a : set (Ξ± Γ Ξ±)}
{b : set (Ξ² Γ Ξ²)} (ha : a β π€ Ξ±) (hb : b β π€ Ξ²) :
{p:(Ξ±ΓΞ²)Γ(Ξ±ΓΞ²) | (p.1.1, p.2.1) β a β§ (p.1.2, p.2.2) β b } β (@uniformity (Ξ± Γ Ξ²) _) :=
by rw [uniformity_prod]; exact inter_mem_inf (preimage_mem_comap ha) (preimage_mem_comap hb)
lemma tendsto_prod_uniformity_fst [uniform_space Ξ±] [uniform_space Ξ²] :
tendsto (Ξ»p:(Ξ±ΓΞ²)Γ(Ξ±ΓΞ²), (p.1.1, p.2.1)) (π€ (Ξ± Γ Ξ²)) (π€ Ξ±) :=
le_trans (map_mono (@inf_le_left (uniform_space (Ξ±ΓΞ²)) _ _ _)) map_comap_le
lemma tendsto_prod_uniformity_snd [uniform_space Ξ±] [uniform_space Ξ²] :
tendsto (Ξ»p:(Ξ±ΓΞ²)Γ(Ξ±ΓΞ²), (p.1.2, p.2.2)) (π€ (Ξ± Γ Ξ²)) (π€ Ξ²) :=
le_trans (map_mono (@inf_le_right (uniform_space (Ξ±ΓΞ²)) _ _ _)) map_comap_le
lemma uniform_continuous_fst [uniform_space Ξ±] [uniform_space Ξ²] :
uniform_continuous (Ξ»p:Ξ±ΓΞ², p.1) :=
tendsto_prod_uniformity_fst
lemma uniform_continuous_snd [uniform_space Ξ±] [uniform_space Ξ²] :
uniform_continuous (Ξ»p:Ξ±ΓΞ², p.2) :=
tendsto_prod_uniformity_snd
variables [uniform_space Ξ±] [uniform_space Ξ²] [uniform_space Ξ³]
lemma uniform_continuous.prod_mk
{fβ : Ξ± β Ξ²} {fβ : Ξ± β Ξ³} (hβ : uniform_continuous fβ) (hβ : uniform_continuous fβ) :
uniform_continuous (Ξ»a, (fβ a, fβ a)) :=
by rw [uniform_continuous, uniformity_prod]; exact
tendsto_inf.2 β¨tendsto_comap_iff.2 hβ, tendsto_comap_iff.2 hββ©
lemma uniform_continuous.prod_mk_left {f : Ξ± Γ Ξ² β Ξ³} (h : uniform_continuous f) (b) :
uniform_continuous (Ξ» a, f (a,b)) :=
h.comp (uniform_continuous_id.prod_mk uniform_continuous_const)
lemma uniform_continuous.prod_mk_right {f : Ξ± Γ Ξ² β Ξ³} (h : uniform_continuous f) (a) :
uniform_continuous (Ξ» b, f (a,b)) :=
h.comp (uniform_continuous_const.prod_mk uniform_continuous_id)
lemma uniform_continuous.prod_map [uniform_space Ξ΄] {f : Ξ± β Ξ³} {g : Ξ² β Ξ΄}
(hf : uniform_continuous f) (hg : uniform_continuous g) :
uniform_continuous (prod.map f g) :=
(hf.comp uniform_continuous_fst).prod_mk (hg.comp uniform_continuous_snd)
lemma to_topological_space_prod {Ξ±} {Ξ²} [u : uniform_space Ξ±] [v : uniform_space Ξ²] :
@uniform_space.to_topological_space (Ξ± Γ Ξ²) prod.uniform_space =
@prod.topological_space Ξ± Ξ² u.to_topological_space v.to_topological_space := rfl
end prod
section
open uniform_space function
variables {Ξ΄' : Type*} [uniform_space Ξ±] [uniform_space Ξ²] [uniform_space Ξ³] [uniform_space Ξ΄]
[uniform_space Ξ΄']
local notation f `ββ` g := function.bicompr f g
/-- Uniform continuity for functions of two variables. -/
def uniform_continuousβ (f : Ξ± β Ξ² β Ξ³) := uniform_continuous (uncurry f)
lemma uniform_continuousβ_def (f : Ξ± β Ξ² β Ξ³) :
uniform_continuousβ f β uniform_continuous (uncurry f) := iff.rfl
lemma uniform_continuousβ.uniform_continuous {f : Ξ± β Ξ² β Ξ³} (h : uniform_continuousβ f) :
uniform_continuous (uncurry f) := h
lemma uniform_continuousβ_curry (f : Ξ± Γ Ξ² β Ξ³) :
uniform_continuousβ (function.curry f) β uniform_continuous f :=
by rw [uniform_continuousβ, uncurry_curry]
lemma uniform_continuousβ.comp {f : Ξ± β Ξ² β Ξ³} {g : Ξ³ β Ξ΄}
(hg : uniform_continuous g) (hf : uniform_continuousβ f) :
uniform_continuousβ (g ββ f) :=
hg.comp hf
lemma uniform_continuousβ.bicompl {f : Ξ± β Ξ² β Ξ³} {ga : Ξ΄ β Ξ±} {gb : Ξ΄' β Ξ²}
(hf : uniform_continuousβ f) (hga : uniform_continuous ga) (hgb : uniform_continuous gb) :
uniform_continuousβ (bicompl f ga gb) :=
hf.uniform_continuous.comp (hga.prod_map hgb)
end
lemma to_topological_space_subtype [u : uniform_space Ξ±] {p : Ξ± β Prop} :
@uniform_space.to_topological_space (subtype p) subtype.uniform_space =
@subtype.topological_space Ξ± p u.to_topological_space := rfl
section sum
variables [uniform_space Ξ±] [uniform_space Ξ²]
open sum
/-- Uniformity on a disjoint union. Entourages of the diagonal in the union are obtained
by taking independently an entourage of the diagonal in the first part, and an entourage of
the diagonal in the second part. -/
def uniform_space.core.sum : uniform_space.core (Ξ± β Ξ²) :=
uniform_space.core.mk'
(map (Ξ» p : Ξ± Γ Ξ±, (inl p.1, inl p.2)) (π€ Ξ±) β map (Ξ» p : Ξ² Γ Ξ², (inr p.1, inr p.2)) (π€ Ξ²))
(Ξ» r β¨Hβ, Hββ© x, by cases x; [apply refl_mem_uniformity Hβ, apply refl_mem_uniformity Hβ])
(Ξ» r β¨Hβ, Hββ©, β¨symm_le_uniformity Hβ, symm_le_uniformity Hββ©)
(Ξ» r β¨HrΞ±, HrΞ²β©, begin
rcases comp_mem_uniformity_sets HrΞ± with β¨tΞ±, htΞ±, HtΞ±β©,
rcases comp_mem_uniformity_sets HrΞ² with β¨tΞ², htΞ², HtΞ²β©,
refine β¨_,
β¨mem_map_iff_exists_image.2 β¨tΞ±, htΞ±, subset_union_left _ _β©,
mem_map_iff_exists_image.2 β¨tΞ², htΞ², subset_union_right _ _β©β©, _β©,
rintros β¨_, _β© β¨z, β¨β¨a, bβ©, hab, β¨β©β© | β¨β¨a, bβ©, hab, β¨β©β©,
β¨β¨_, cβ©, hbc, β¨β©β© | β¨β¨_, cβ©, hbc, β¨β©β©β©,
{ have A : (a, c) β tΞ± β tΞ± := β¨b, hab, hbcβ©,
exact HtΞ± A },
{ have A : (a, c) β tΞ² β tΞ² := β¨b, hab, hbcβ©,
exact HtΞ² A }
end)
/-- The union of an entourage of the diagonal in each set of a disjoint union is again an entourage
of the diagonal. -/
lemma union_mem_uniformity_sum
{a : set (Ξ± Γ Ξ±)} (ha : a β π€ Ξ±) {b : set (Ξ² Γ Ξ²)} (hb : b β π€ Ξ²) :
((Ξ» p : (Ξ± Γ Ξ±), (inl p.1, inl p.2)) '' a βͺ (Ξ» p : (Ξ² Γ Ξ²), (inr p.1, inr p.2)) '' b) β
(@uniform_space.core.sum Ξ± Ξ² _ _).uniformity :=
β¨mem_map_iff_exists_image.2 β¨_, ha, subset_union_left _ _β©,
mem_map_iff_exists_image.2 β¨_, hb, subset_union_right _ _β©β©
/- To prove that the topology defined by the uniform structure on the disjoint union coincides with
the disjoint union topology, we need two lemmas saying that open sets can be characterized by
the uniform structure -/
lemma uniformity_sum_of_open_aux {s : set (Ξ± β Ξ²)} (hs : is_open s) {x : Ξ± β Ξ²} (xs : x β s) :
{ p : ((Ξ± β Ξ²) Γ (Ξ± β Ξ²)) | p.1 = x β p.2 β s } β (@uniform_space.core.sum Ξ± Ξ² _ _).uniformity :=
begin
cases x,
{ refine mem_of_superset
(union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (is_open.mem_nhds hs.1 xs))
univ_mem)
(union_subset _ _);
rintro _ β¨β¨_, bβ©, h, β¨β©β© β¨β©,
exact h rfl },
{ refine mem_of_superset
(union_mem_uniformity_sum univ_mem (mem_nhds_uniformity_iff_right.1
(is_open.mem_nhds hs.2 xs)))
(union_subset _ _);
rintro _ β¨β¨a, _β©, h, β¨β©β© β¨β©,
exact h rfl },
end
lemma open_of_uniformity_sum_aux {s : set (Ξ± β Ξ²)}
(hs : βx β s, { p : ((Ξ± β Ξ²) Γ (Ξ± β Ξ²)) | p.1 = x β p.2 β s } β
(@uniform_space.core.sum Ξ± Ξ² _ _).uniformity) :
is_open s :=
begin
split,
{ refine (@is_open_iff_mem_nhds Ξ± _ _).2 (Ξ» a ha, mem_nhds_uniformity_iff_right.2 _),
rcases mem_map_iff_exists_image.1 (hs _ ha).1 with β¨t, ht, stβ©,
refine mem_of_superset ht _,
rintro p pt rfl, exact st β¨_, pt, rflβ© rfl },
{ refine (@is_open_iff_mem_nhds Ξ² _ _).2 (Ξ» b hb, mem_nhds_uniformity_iff_right.2 _),
rcases mem_map_iff_exists_image.1 (hs _ hb).2 with β¨t, ht, stβ©,
refine mem_of_superset ht _,
rintro p pt rfl, exact st β¨_, pt, rflβ© rfl }
end
/- We can now define the uniform structure on the disjoint union -/
instance sum.uniform_space : uniform_space (Ξ± β Ξ²) :=
{ to_core := uniform_space.core.sum,
is_open_uniformity := Ξ» s, β¨uniformity_sum_of_open_aux, open_of_uniformity_sum_auxβ© }
lemma sum.uniformity : π€ (Ξ± β Ξ²) =
map (Ξ» p : Ξ± Γ Ξ±, (inl p.1, inl p.2)) (π€ Ξ±) β
map (Ξ» p : Ξ² Γ Ξ², (inr p.1, inr p.2)) (π€ Ξ²) := rfl
end sum
end constructions
-- For a version of the Lebesgue number lemma assuming only a sequentially compact space,
-- see topology/sequences.lean
/-- Let `c : ΞΉ β set Ξ±` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x β s` its `n`-neighborhood is contained in some `c i`. -/
lemma lebesgue_number_lemma {Ξ± : Type u} [uniform_space Ξ±] {s : set Ξ±} {ΞΉ} {c : ΞΉ β set Ξ±}
(hs : is_compact s) (hcβ : β i, is_open (c i)) (hcβ : s β β i, c i) :
β n β π€ Ξ±, β x β s, β i, {y | (x, y) β n} β c i :=
begin
let u := Ξ» n, {x | β i (m β π€ Ξ±), {y | (x, y) β m β n} β c i},
have huβ : β n β π€ Ξ±, is_open (u n),
{ refine Ξ» n hn, is_open_uniformity.2 _,
rintro x β¨i, m, hm, hβ©,
rcases comp_mem_uniformity_sets hm with β¨m', hm', mm'β©,
apply (π€ Ξ±).sets_of_superset hm',
rintros β¨x, yβ© hp rfl,
refine β¨i, m', hm', Ξ» z hz, h (monotone_comp_rel monotone_id monotone_const mm' _)β©,
dsimp [-mem_comp_rel] at hz β’, rw comp_rel_assoc,
exact β¨y, hp, hzβ© },
have huβ : s β β n β π€ Ξ±, u n,
{ intros x hx,
rcases mem_Union.1 (hcβ hx) with β¨i, hβ©,
rcases comp_mem_uniformity_sets (is_open_uniformity.1 (hcβ i) x h) with β¨m', hm', mm'β©,
exact mem_bUnion hm' β¨i, _, hm', Ξ» y hy, mm' hy rflβ© },
rcases hs.elim_finite_subcover_image huβ huβ with β¨b, bu, b_fin, b_coverβ©,
refine β¨_, (bInter_mem b_fin).2 bu, Ξ» x hx, _β©,
rcases mem_Unionβ.1 (b_cover hx) with β¨n, bn, i, m, hm, hβ©,
refine β¨i, Ξ» y hy, h _β©,
exact prod_mk_mem_comp_rel (refl_mem_uniformity hm) (bInter_subset_of_mem bn hy)
end
/-- Let `c : set (set Ξ±)` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x β s` its `n`-neighborhood is contained in some `t β c`. -/
lemma lebesgue_number_lemma_sUnion {Ξ± : Type u} [uniform_space Ξ±] {s : set Ξ±} {c : set (set Ξ±)}
(hs : is_compact s) (hcβ : β t β c, is_open t) (hcβ : s β ββ c) :
β n β π€ Ξ±, β x β s, β t β c, β y, (x, y) β n β y β t :=
by rw sUnion_eq_Union at hcβ;
simpa using lebesgue_number_lemma hs (by simpa) hcβ
/-- A useful consequence of the Lebesgue number lemma: given any compact set `K` contained in an
open set `U`, we can find an (open) entourage `V` such that the ball of size `V` about any point of
`K` is contained in `U`. -/
lemma lebesgue_number_of_compact_open [uniform_space Ξ±]
{K U : set Ξ±} (hK : is_compact K) (hU : is_open U) (hKU : K β U) :
β V β π€ Ξ±, is_open V β§ β x β K, uniform_space.ball x V β U :=
begin
let W : K β set (Ξ± Γ Ξ±) := Ξ» k, classical.some $ is_open_iff_open_ball_subset.mp hU k.1 $ hKU k.2,
have hW : β k, W k β π€ Ξ± β§ is_open (W k) β§ uniform_space.ball k.1 (W k) β U,
{ intros k,
obtain β¨hβ, hβ, hββ© := classical.some_spec (is_open_iff_open_ball_subset.mp hU k.1 (hKU k.2)),
exact β¨hβ, hβ, hββ©, },
let c : K β set Ξ± := Ξ» k, uniform_space.ball k.1 (W k),
have hcβ : β k, is_open (c k), { exact Ξ» k, uniform_space.is_open_ball k.1 (hW k).2.1, },
have hcβ : K β β i, c i,
{ intros k hk,
simp only [mem_Union, set_coe.exists],
exact β¨k, hk, uniform_space.mem_ball_self k (hW β¨k, hkβ©).1β©, },
have hcβ : β k, c k β U, { exact Ξ» k, (hW k).2.2, },
obtain β¨V, hV, hV'β© := lebesgue_number_lemma hK hcβ hcβ,
refine β¨interior V, interior_mem_uniformity hV, is_open_interior, _β©,
intros k hk,
obtain β¨k', hk'β© := hV' k hk,
exact ((ball_mono interior_subset k).trans hk').trans (hcβ k'),
end
/-!
### Expressing continuity properties in uniform spaces
We reformulate the various continuity properties of functions taking values in a uniform space
in terms of the uniformity in the target. Since the same lemmas (essentially with the same names)
also exist for metric spaces and emetric spaces (reformulating things in terms of the distance or
the edistance in the target), we put them in a namespace `uniform` here.
In the metric and emetric space setting, there are also similar lemmas where one assumes that
both the source and the target are metric spaces, reformulating things in terms of the distance
on both sides. These lemmas are generally written without primes, and the versions where only
the target is a metric space is primed. We follow the same convention here, thus giving lemmas
with primes.
-/
namespace uniform
variables [uniform_space Ξ±]
theorem tendsto_nhds_right {f : filter Ξ²} {u : Ξ² β Ξ±} {a : Ξ±} :
tendsto u f (π a) β tendsto (Ξ» x, (a, u x)) f (π€ Ξ±) :=
β¨Ξ» H, tendsto_left_nhds_uniformity.comp H,
Ξ» H s hs, by simpa [mem_of_mem_nhds hs] using H (mem_nhds_uniformity_iff_right.1 hs)β©
theorem tendsto_nhds_left {f : filter Ξ²} {u : Ξ² β Ξ±} {a : Ξ±} :
tendsto u f (π a) β tendsto (Ξ» x, (u x, a)) f (π€ Ξ±) :=
β¨Ξ» H, tendsto_right_nhds_uniformity.comp H,
Ξ» H s hs, by simpa [mem_of_mem_nhds hs] using H (mem_nhds_uniformity_iff_left.1 hs)β©
theorem continuous_at_iff'_right [topological_space Ξ²] {f : Ξ² β Ξ±} {b : Ξ²} :
continuous_at f b β tendsto (Ξ» x, (f b, f x)) (π b) (π€ Ξ±) :=
by rw [continuous_at, tendsto_nhds_right]
theorem continuous_at_iff'_left [topological_space Ξ²] {f : Ξ² β Ξ±} {b : Ξ²} :
continuous_at f b β tendsto (Ξ» x, (f x, f b)) (π b) (π€ Ξ±) :=
by rw [continuous_at, tendsto_nhds_left]
theorem continuous_at_iff_prod [topological_space Ξ²] {f : Ξ² β Ξ±} {b : Ξ²} :
continuous_at f b β tendsto (Ξ» x : Ξ² Γ Ξ², (f x.1, f x.2)) (π (b, b)) (π€ Ξ±) :=
β¨Ξ» H, le_trans (H.prod_map' H) (nhds_le_uniformity _),
Ξ» H, continuous_at_iff'_left.2 $ H.comp $ tendsto_id.prod_mk_nhds tendsto_const_nhdsβ©
theorem continuous_within_at_iff'_right [topological_space Ξ²] {f : Ξ² β Ξ±} {b : Ξ²} {s : set Ξ²} :
continuous_within_at f s b β tendsto (Ξ» x, (f b, f x)) (π[s] b) (π€ Ξ±) :=
by rw [continuous_within_at, tendsto_nhds_right]
theorem continuous_within_at_iff'_left [topological_space Ξ²] {f : Ξ² β Ξ±} {b : Ξ²} {s : set Ξ²} :
continuous_within_at f s b β tendsto (Ξ» x, (f x, f b)) (π[s] b) (π€ Ξ±) :=
by rw [continuous_within_at, tendsto_nhds_left]
theorem continuous_on_iff'_right [topological_space Ξ²] {f : Ξ² β Ξ±} {s : set Ξ²} :
continuous_on f s β β b β s, tendsto (Ξ» x, (f b, f x)) (π[s] b) (π€ Ξ±) :=
by simp [continuous_on, continuous_within_at_iff'_right]
theorem continuous_on_iff'_left [topological_space Ξ²] {f : Ξ² β Ξ±} {s : set Ξ²} :
continuous_on f s β β b β s, tendsto (Ξ» x, (f x, f b)) (π[s] b) (π€ Ξ±) :=
by simp [continuous_on, continuous_within_at_iff'_left]
theorem continuous_iff'_right [topological_space Ξ²] {f : Ξ² β Ξ±} :
continuous f β β b, tendsto (Ξ» x, (f b, f x)) (π b) (π€ Ξ±) :=
continuous_iff_continuous_at.trans $ forall_congr $ Ξ» b, tendsto_nhds_right
theorem continuous_iff'_left [topological_space Ξ²] {f : Ξ² β Ξ±} :
continuous f β β b, tendsto (Ξ» x, (f x, f b)) (π b) (π€ Ξ±) :=
continuous_iff_continuous_at.trans $ forall_congr $ Ξ» b, tendsto_nhds_left
end uniform
lemma filter.tendsto.congr_uniformity {Ξ± Ξ²} [uniform_space Ξ²] {f g : Ξ± β Ξ²} {l : filter Ξ±} {b : Ξ²}
(hf : tendsto f l (π b)) (hg : tendsto (Ξ» x, (f x, g x)) l (π€ Ξ²)) :
tendsto g l (π b) :=
uniform.tendsto_nhds_right.2 $ (uniform.tendsto_nhds_right.1 hf).uniformity_trans hg
lemma uniform.tendsto_congr {Ξ± Ξ²} [uniform_space Ξ²] {f g : Ξ± β Ξ²} {l : filter Ξ±} {b : Ξ²}
(hfg : tendsto (Ξ» x, (f x, g x)) l (π€ Ξ²)) :
tendsto f l (π b) β tendsto g l (π b) :=
β¨Ξ» h, h.congr_uniformity hfg, Ξ» h, h.congr_uniformity hfg.uniformity_symmβ©
|
namespace prop_19
variables A B : Prop
theorem prop_19 : (Β¬ Β¬ A β§ Β¬ Β¬ (A β B)) β Β¬ Β¬ B :=
assume h1: Β¬ Β¬ A β§ Β¬ Β¬ (A β B),
have h2: Β¬ Β¬ A, from and.left h1,
have h3: A, from (classical.by_contradiction
(assume h4: Β¬ A,
h2 h4)),
have h5: Β¬ Β¬ (A β B), from and.right h1,
have h6: A β B, from (classical.by_contradiction
(assume h7: Β¬(A β B),
h5 h7)),
assume h8: Β¬ B,
show false, from h8 (h6 h3)
-- end namespace
end prop_19 |
theory Reihen
imports Complex_Main
begin
lemma gauss : "(\<Sum>i=0 .. (n::nat) . i) = n*(n+1) div 2"
proof (induct n)
case 0
show ?case by simp
next
case (Suc n)
assume "\<Sum>{0..n} = n * (n + 1) div 2"
thus ?case by simp
qed
lemma "(\<Sum>i=0..(n::nat) . (2*i - 1)) = n^2"
using [[simp_trace_new mode=full]]
proof (induct n)
case 0
show ?case by simp
next
fix n
case (Suc n)
assume a:"(\<Sum>i = 0..n. 2 * i - 1) = n\<^sup>2"
have " ((\<Sum>i = 0..Suc n. 2 * i - 1) = (Suc n)\<^sup>2) = ( (2*n+1) + (\<Sum>i = 0.. n. 2 * i - 1) = (Suc n)\<^sup>2)" by auto
also have " \<dots> = ( (2*n+1) + (\<Sum>i = 0.. n. 2 * i - 1) = (n + 1)^2)" by simp
also have "\<dots> = ( (2*n+1) + (\<Sum>i = 0.. n. 2 * i - 1) = n^2 + 2*n + 1) " unfolding power2_sum by simp
also from a have " \<dots> = ( (2*n+1) + n^2 = n^2 + 2*n + 1) " by auto
finally show ?case by auto
qed
lemma fixes n::nat shows"(\<Sum>i = 1 .. n . i^2) = (n*(n + 1)*(2*n + 1)) div 6"
proof (induct n)
case 0
show ?case by simp
next
fix n::nat
case (Suc n)
assume hyp:"(\<Sum>i = 1..n. i\<^sup>2) = (n * (n + 1) * (2 * n + 1)) div 6"
have "Suc n * (Suc n + 1) * (2 * Suc n + 1) = (n + 1) * (n + 2) * (2 * n + 2 + 1) " by simp
also have " \<dots> = (n^2 +3*n + 2) * (2 * n + 2 +1)" by (simp add : power2_eq_square)
also have "\<dots> = (n^2 +3*n + 2) * (2 * n + 3)"
proof -
have tmp:"(2 * n + 2 +1) = (2 * n + 3)" by auto
show ?thesis by (simp only: tmp )
qed
also have "\<dots> = (n^2 +3*n + 2)*2*n + (n^2 +3*n + 2)*3" by (simp only : ring_distribs)
also have "\<dots> = (n^2 +3*n + 2)*2*n + 3*n^2 +9*n + 6 " by (simp only : ring_distribs)
also have "\<dots> = 2*(n^2)*n +6*n^2 + 4*n + 3*n^2 +9*n + 6" by (simp add : ring_distribs power2_eq_square)
also have "\<dots> = 2*n^3 +9*n^2 + 13*n + 6 " by (simp add: power2_eq_square power3_eq_cube)
finally have " (Suc n * (Suc n + 1) * (2 * Suc n + 1)) div 6 = (2 * n ^ 3 + 9 * n\<^sup>2 + 13 * n + 6) div 6" by simp
note tmpResult1 = this
have "(\<Sum>i = 1..Suc n. i\<^sup>2) = (\<Sum>i = 1 .. (n + 1). i\<^sup>2)" by simp
also have "\<dots> = (n^2 + 2*n + 1)+ (\<Sum>i = 1 .. n. i\<^sup>2)" by (simp add : power2_eq_square)
also have "\<dots> = (6*(n^2 + 2*n + 1) div 6) + (\<Sum>i = 1 .. n. i\<^sup>2)" by auto
also have "\<dots> = ((6*n^2 + 12*n + 6) div 6) + (\<Sum>i = 1 .. n. i\<^sup>2)" by simp
also have "\<dots> = ((6*n^2 + 12*n + 6) div 6) + (n * (n + 1) * (2 * n + 1)) div 6 " unfolding hyp by simp
also have "\<dots> = ((6*n^2 + 12*n + 6) + (n * (n + 1) * (2 * n + 1)))div 6 " by simp
also have "\<dots> = ((6*n^2 + 12*n + 6) + ((n^2 + n)* (2 * n + 1))) div 6" by (simp add : power2_eq_square ring_distribs)
also have "\<dots> = ((6*n^2 + 12*n + 6) + (2*n^3 + 3*n^2 + n)) div 6" by (simp add : power2_eq_square power3_eq_cube ring_distribs)
also have "\<dots> = (2*n^3 + 9*n^2 + 13*n + 6) div 6 " by simp
note tmpResult2 = calculation
from tmpResult1 and tmpResult2 show ?case by simp
qed
theorem fixes n:: nat and p::nat and q::nat shows "\<Sum> i = 0 .. n . "
lemma " suminf (\<lambda>n. c^n) = (1 / (1 - c))"
proof
|
{-# OPTIONS --cumulativity #-}
open import Agda.Primitive
data Unit : Set where unit : Unit
record Container a : Set (lsuc a) where
constructor _β_
field
Shape : Set a
Pos : Shape β Set a
open Container public
data Free {a : Level} (C : Container a) (A : Unit β Set a) : Set a where
pure : A unit β Free C A
impure : (s : Shape C) β (Pos C s β Free C A) β Free C A
ROp : β a β Container (lsuc a)
ROp a = Set a β Ξ» x β x
rop : {a : Level} {A : Unit β Set a} β Free (ROp a) A
rop {_} {A} = impure (A unit) pure
ropβ² : {a : Level} {A : Unit β Set (lsuc a)} β Free (ROp a) A
ropβ² {a} {A} = rop {a} -- This should not work, A : Set (suc a) is too large.
-- Passing it as an implicit parameter {A} gives the expected error.
|
[STATEMENT]
lemma HNF_algorithm_soundness:
assumes A: "A \<in> carrier_mat m n"
shows "Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A)
\<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> (HNF_algorithm abs_flag A) = P * A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
proof (cases "m\<noteq>n \<or> Determinant.det A = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m \<noteq> n \<or> det A = 0
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
have H_rw: "HNF_algorithm abs_flag A = Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<m]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. HNF_algorithm abs_flag A = Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<m]
[PROOF STEP]
using True A
[PROOF STATE]
proof (prove)
using this:
m \<noteq> n \<or> det A = 0
A \<in> carrier_mat m n
goal (1 subgoal):
1. HNF_algorithm abs_flag A = Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<m]
[PROOF STEP]
unfolding HNF_algorithm_def Let_def
[PROOF STATE]
proof (prove)
using this:
m \<noteq> n \<or> det A = 0
A \<in> carrier_mat m n
goal (1 subgoal):
1. (if dim_row A \<noteq> dim_col A then Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<dim_row A] else if \<bar>det_int A\<bar> = 0 then Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<dim_row A] else mat_of_rows (dim_col A) (map (row (Hermite_of_list_of_rows (FindPreHNF abs_flag \<bar>det_int A\<bar> (A @\<^sub>r \<bar>det_int A\<bar> \<cdot>\<^sub>m 1\<^sub>m (dim_col A))) [0..<dim_row A + dim_col A])) [0..<dim_row A])) = Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<m]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
HNF_algorithm abs_flag A = Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<m]
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
have "(\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> (HNF_algorithm abs_flag A) = P * (FindPreHNF_rectangular A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * FindPreHNF_rectangular A
[PROOF STEP]
unfolding H_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<m] = P * FindPreHNF_rectangular A
[PROOF STEP]
proof (rule invertible_Hermite_of_list_of_rows)
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. FindPreHNF_rectangular A \<in> carrier_mat m ?n
2. echelon_form_JNF (FindPreHNF_rectangular A)
[PROOF STEP]
show "FindPreHNF_rectangular A \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. FindPreHNF_rectangular A \<in> carrier_mat m n
[PROOF STEP]
by (smt A FindPreHNF_rectangular_soundness mult_carrier_mat)
[PROOF STATE]
proof (state)
this:
FindPreHNF_rectangular A \<in> carrier_mat m n
goal (1 subgoal):
1. echelon_form_JNF (FindPreHNF_rectangular A)
[PROOF STEP]
show "echelon_form_JNF (FindPreHNF_rectangular A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. echelon_form_JNF (FindPreHNF_rectangular A)
[PROOF STEP]
using FindPreHNF_rectangular_soundness
[PROOF STATE]
proof (prove)
using this:
?A \<in> carrier_mat ?m ?n \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat ?m ?m \<and> P * ?A = FindPreHNF_rectangular ?A \<and> echelon_form_JNF (FindPreHNF_rectangular ?A)
goal (1 subgoal):
1. echelon_form_JNF (FindPreHNF_rectangular A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
echelon_form_JNF (FindPreHNF_rectangular A)
goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * FindPreHNF_rectangular A
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * FindPreHNF_rectangular A
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
have "(\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> (FindPreHNF_rectangular A) = P * A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> FindPreHNF_rectangular A = P * A
[PROOF STEP]
by (metis A FindPreHNF_rectangular_soundness)
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> FindPreHNF_rectangular A = P * A
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * FindPreHNF_rectangular A
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> FindPreHNF_rectangular A = P * A
[PROOF STEP]
have "(\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> (HNF_algorithm abs_flag A) = P * A)"
[PROOF STATE]
proof (prove)
using this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * FindPreHNF_rectangular A
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> FindPreHNF_rectangular A = P * A
goal (1 subgoal):
1. \<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A
[PROOF STEP]
by (smt assms assoc_mult_mat invertible_mult_JNF mult_carrier_mat)
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
have "Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A)
[PROOF STEP]
by (metis A FindPreHNF_rectangular_soundness H_rw Hermite_Hermite_of_list_of_rows mult_carrier_mat)
[PROOF STATE]
proof (state)
this:
Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A)
goal (2 subgoals):
1. m \<noteq> n \<or> det A = 0 \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
2. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A
Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A
Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A)
goal (1 subgoal):
1. Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
goal (1 subgoal):
1. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (m \<noteq> n \<or> det A = 0)
goal (1 subgoal):
1. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
hence mn: "m=n" and det_A_not0:"(Determinant.det A) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (m \<noteq> n \<or> det A = 0)
goal (1 subgoal):
1. m = n &&& det A \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = n
det A \<noteq> 0
goal (1 subgoal):
1. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
have inv_RAT_A: "invertible_mat (map_mat rat_of_int A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. invertible_mat (of_int_hom.mat_hom A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. invertible_mat (of_int_hom.mat_hom A)
[PROOF STEP]
have "det (map_mat rat_of_int A) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. det (of_int_hom.mat_hom A) \<noteq> 0
[PROOF STEP]
using det_A_not0
[PROOF STATE]
proof (prove)
using this:
det A \<noteq> 0
goal (1 subgoal):
1. det (of_int_hom.mat_hom A) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det (of_int_hom.mat_hom A) \<noteq> 0
goal (1 subgoal):
1. invertible_mat (of_int_hom.mat_hom A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
det (of_int_hom.mat_hom A) \<noteq> 0
goal (1 subgoal):
1. invertible_mat (of_int_hom.mat_hom A)
[PROOF STEP]
by (metis False assms dvd_field_iff invertible_iff_is_unit_JNF map_carrier_mat)
[PROOF STATE]
proof (state)
this:
invertible_mat (of_int_hom.mat_hom A)
goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invertible_mat (of_int_hom.mat_hom A)
goal (1 subgoal):
1. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
have "HNF_algorithm abs_flag A = Hermite_mod_det abs_flag A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. HNF_algorithm abs_flag A = Hermite_mod_det abs_flag A
[PROOF STEP]
unfolding HNF_algorithm_def Hermite_mod_det_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (if dim_row A \<noteq> dim_col A then Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<dim_row A] else if \<bar>det_int A\<bar> = 0 then Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<dim_row A] else mat_of_rows (dim_col A) (map (row (Hermite_of_list_of_rows (FindPreHNF abs_flag \<bar>det_int A\<bar> (A @\<^sub>r \<bar>det_int A\<bar> \<cdot>\<^sub>m 1\<^sub>m (dim_col A))) [0..<dim_row A + dim_col A])) [0..<dim_row A])) = mat_of_rows (dim_col A) (map (row (Hermite_of_list_of_rows (FindPreHNF abs_flag \<bar>det_int A\<bar> (A @\<^sub>r \<bar>det_int A\<bar> \<cdot>\<^sub>m 1\<^sub>m (dim_col A))) [0..<dim_row A + dim_col A])) [0..<dim_row A])
[PROOF STEP]
using False A
[PROOF STATE]
proof (prove)
using this:
\<not> (m \<noteq> n \<or> det A = 0)
A \<in> carrier_mat m n
goal (1 subgoal):
1. (if dim_row A \<noteq> dim_col A then Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<dim_row A] else if \<bar>det_int A\<bar> = 0 then Hermite_of_list_of_rows (FindPreHNF_rectangular A) [0..<dim_row A] else mat_of_rows (dim_col A) (map (row (Hermite_of_list_of_rows (FindPreHNF abs_flag \<bar>det_int A\<bar> (A @\<^sub>r \<bar>det_int A\<bar> \<cdot>\<^sub>m 1\<^sub>m (dim_col A))) [0..<dim_row A + dim_col A])) [0..<dim_row A])) = mat_of_rows (dim_col A) (map (row (Hermite_of_list_of_rows (FindPreHNF abs_flag \<bar>det_int A\<bar> (A @\<^sub>r \<bar>det_int A\<bar> \<cdot>\<^sub>m 1\<^sub>m (dim_col A))) [0..<dim_row A + dim_col A])) [0..<dim_row A])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
HNF_algorithm abs_flag A = Hermite_mod_det abs_flag A
goal (1 subgoal):
1. \<not> (m \<noteq> n \<or> det A = 0) \<Longrightarrow> Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
HNF_algorithm abs_flag A = Hermite_mod_det abs_flag A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
HNF_algorithm abs_flag A = Hermite_mod_det abs_flag A
goal (1 subgoal):
1. Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
using Hermite_mod_det_soundness[OF mn A inv_RAT_A]
[PROOF STATE]
proof (prove)
using this:
HNF_algorithm abs_flag A = Hermite_mod_det abs_flag A
Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (Hermite_mod_det ?abs_flag A)
\<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> Hermite_mod_det ?abs_flag A = P * A
goal (1 subgoal):
1. Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Hermite_JNF (range ass_function_euclidean) (\<lambda>c. range (res_int c)) (HNF_algorithm abs_flag A) \<and> (\<exists>P. P \<in> carrier_mat m m \<and> invertible_mat P \<and> HNF_algorithm abs_flag A = P * A)
goal:
No subgoals!
[PROOF STEP]
qed |
\ https://rosettacode.org/wiki/Sum_digits_of_an_integer#Forh
: SUM-INT 0 BEGIN OVER WHILE SWAP BASE @ /MOD SWAP ROT + REPEAT NIP ;
T{ 2 BASE ! 11110 SUM-INT -> #4 }T
T{ DECIMAL 12345 SUM-INT -> #15 }T
T{ HEX F0E SUM-INT -> #29 }T
|
Following acts are also considered as violation of the seventh commandment : price manipulation to get advantage on the harm of others , corruption , appropriation of the public goods for personal interests , work poorly carried out , tax avoidance , counterfeiting of checks or any means of payment , any forms of copyright infringement and piracy , and extravagance .
|
State Before: a b c : Int
β’ (a + b) * c = a * c + b * c State After: no goals Tactic: simp [Int.mul_comm, Int.mul_add] |
The Irish Football Association ( IFA ) was originally the governing body for soccer across the island . The game has been played in an organised fashion in Ireland since the 1870s , with Cliftonville F.C. in Belfast being Ireland 's oldest club . It was most popular , especially in its first decades , around Belfast and in Ulster . However , some clubs based outside Belfast thought that the IFA largely favoured Ulster @-@ based clubs in such matters as selection for the national team . In 1921 , following an incident in which , despite an earlier promise , the IFA moved an Irish Cup semi @-@ final replay from Dublin to Belfast , Dublin @-@ based clubs broke away to form the Football Association of the Irish Free State . Today the southern association is known as the Football Association of Ireland ( FAI ) . Despite being initially blacklisted by the Home Nations ' associations , the FAI was recognised by FIFA in 1923 and organised its first international fixture in 1926 ( against Italy ) . However , both the IFA and FAI continued to select their teams from the whole of Ireland , with some players earning international caps for matches with both teams . Both also referred to their respective teams as Ireland .
|
import algebra.periodic
/-!
# Big operators on periodic sequences indexed by β
Here we just prove the following result.
Let `M` be a commutative monoid and `n : β`.
Let `a : β β M` be an `n`-periodic sequence.
Then `β [i < n] a(i) = β [i < n] a(i + k)` for any `k : β`.
Similar results hold when `M` is a commutative additive monoid with sums.
-/
namespace IMOSL
namespace extra
open function finset
lemma periodic_prod_const {M : Type*} [comm_monoid M] {a : β β M} {n : β}
(h : periodic a n) (k : β) : (range n).prod (Ξ» m, a (m + k)) = (range n).prod a :=
begin
induction k with k k_ih,
simp only [add_zero],
conv_lhs { congr, skip, funext, rw [nat.succ_eq_one_add, β add_assoc] },
cases n with n n,
rw [prod_range_zero, prod_range_zero],
rw [prod_range_succ, add_comm, h, β k_ih, prod_range_succ', zero_add]
end
lemma periodic_sum_const {M : Type*} [add_comm_monoid M] {a : β β M} {n : β}
(h : periodic a n) (k : β) : (range n).sum (Ξ» m, a (m + k)) = (range n).sum a :=
begin
induction k with k k_ih,
simp only [add_zero],
conv_lhs { congr, skip, funext, rw [nat.succ_eq_one_add, β add_assoc] },
cases n with n n,
rw [sum_range_zero, sum_range_zero],
rw [sum_range_succ, add_comm (n + 1), h, β k_ih, sum_range_succ', zero_add]
end
end extra
end IMOSL
|
theory Exercise5p4
imports Main
begin
inductive ev :: "nat \<Rightarrow> bool" where
ev0: "ev 0"
| evSS: "ev n \<Longrightarrow> ev (Suc (Suc n))"
(* Exercise 5.4 *)
lemma "\<not> ev (Suc (Suc (Suc 0)))" (is "\<not>?P")
proof
assume "?P"
then have "ev (Suc 0)" by cases (* This is the same as "proof cases qed" because
there is nothing to prove *)
then show False by cases
qed
end |
(* begin hide *)
Require Export HoTT Ch04.
(* end hide *)
(** printing <~> %\ensuremath{\eqvsym}% **)
(** printing == %\ensuremath{\sim}% **)
(** printing ^-1 %\ensuremath{^{-1}}% **)
(** * Induction *)
(** %\exerdone{5.1}{175}%
Derive the induction principle for the type $\lst{A}$ of lists from its
definition as an inductive type in %\S5.1%.
*)
(** %\soln%
The induction principle constructs an element $f : \prd{\ell:\lst{A}} P(\ell)$
for some family $P : \lst{A} \to \UU$. The constructors for $\lst{A}$ are
$\nil : \lst{A}$ and $\cons : A \to \lst{A} \to \lst{A}$, so the hypothesis for
the induction principle is given by
%\[
d : P(\nil)
\to \left(\prd{h:A} \prd{t:\lst{A}}P(t) \to P(\cons(h, t))\right)
\to \prd{\ell:\lst{A}}P(\ell)
\]%
So, given a $p_{n} : P(\nil)$ and a function $p_{c} : \prd{h:A} \prd{t:\lst{A}}
P(t) \to P(\cons(h, t))$, we obtain a function $f : \prd{\ell:\lst{A}}P(\ell)$
with the following computation rules:
%\begin{align*}
f(\nil) &\defeq p_{n} \\
f(\cons(h, t)) &\defeq p_{c}(h, t, f(t))
\end{align*}%
In Coq we can just use the pattern-matching syntax.
*)
Module Ex1.
Section Ex1.
Variable A : Type.
Variable P : list A -> Type.
Hypothesis d : P nil
-> (forall h t, P t -> P (cons h t))
-> forall l, P l.
Variable p_n : P nil.
Variable p_c : forall h t, P t -> P (cons h t).
Fixpoint f (l : list A) : P l :=
match l with
| nil => p_n
| cons h t => p_c h t (f t)
end.
End Ex1.
End Ex1.
(** %\exerdone{5.2}{175}%
Construct two functions on natural numbers which satisfy the same recurrence
$(e_{z}, e_{s})$ but are not definitionally equal.
*)
(** %\soln%
Let $C$ be any type, with $c : C$ some element. The constant function
$f' \defeq \lam{n}c$ is not definitionally equal to the function
defined recursively by
%\begin{align*}
f(0) &\defeq c \\
f(\suc(n)) &\defeq f(n)
\end{align*}%
However, they both satisfy the same recurrence; namely, $e_{z} \defeq c$ and
$e_{s} \defeq \lam{n}\idfunc{C}$.
*)
Module Ex2.
Section Ex2.
Variables (C : Type) (c : C).
Definition f (n : nat) := c.
Fixpoint f' (n : nat) :=
match n with
| O => c
| S n' => f' n'
end.
Theorem ex5_2_O : f O = f' O.
Proof.
reflexivity.
Qed.
Theorem ex5_2_S : forall n, f (S n) = f' (S n).
Proof.
intros. unfold f, f'.
induction n. reflexivity. apply IHn.
Qed.
End Ex2.
End Ex2.
(** %\exerdone{5.3}{175}%
Construct two different recurrences $(e_{z}, e_{s})$ on the same type $E$ which
are both satisfied by the same function $f : \N \to E$.
*)
(** %\soln%
From the previous exercise we have the recurrences
%\[
e_{z} \defeq c
\qquad\qquad
e_{s} \defeq \lam{n}\idfunc{C}
\]%
which give rise to the same function as the recurrences
%\[
e'_{z} \defeq c
\qquad\qquad
e'_{s} \defeq \lam{n}\lam{x}c
\]%
Clearly $f \defeq \lam{n}c$ satisfies both of these recurrences.
However, suppose that $c, c' : C$ are such that $c \neq c'$. Then
$\lam{n}\lam{x} \neq \lam{n}\idfunc{C}$, so $e_{s} \neq e'_{s}$, so
the recurrences are not equal.
*)
Module Ex3.
Section Ex3.
Variables (C : Type) (c c' : C) (p : ~ (c = c')).
Definition ez := c.
Definition es (n : nat) (x : C) := x.
Definition ez' := c.
Definition es' (n : nat) := fun (x : C) => c.
Theorem f_O : Ex2.f C c O = ez.
Proof.
reflexivity.
Defined.
Theorem f_S : forall n, Ex2.f C c (S n) = es n (Ex2.f C c n).
Proof.
reflexivity.
Defined.
Theorem f_O' : Ex2.f C c O = ez'.
Proof.
reflexivity.
Defined.
Theorem f_S' : forall n, Ex2.f C c (S n) = es' n (Ex2.f C c n).
Proof.
reflexivity.
Defined.
Theorem ex5_3 : ~ ((ez, es) = (ez', es')).
Proof.
intro q. apply (ap snd) in q. simpl in q. unfold es, es' in q.
assert (idmap = fun x:C => c) as r.
apply (apD10 q O).
assert (c' = c) as s.
apply (apD10 r).
symmetry in s.
contradiction p.
Defined.
End Ex3.
End Ex3.
(** %\exerdone{5.4}{175}%
Show that for any type family $E : \bool \to \UU$, the induction operator
%\[
\ind{\bool}(E) :
(E(0_{\bool}) \times E(1_{\bool}))
\to
\prd{b : \bool} E(b)
\]%
is an equivalence.
*)
(** %\soln%
For a quasi-inverse, suppose that $f : \prd{b:\bool} E(b)$. To provide an
element of $E(0_{\bool}) \times E(1_{\bool})$, we take the pair $(f(0_{\bool}),
f(1_{\bool}))$. For one direction around the loop, consider an element
$(e_{0}, e_{1})$ of the domain. We then have
%\[
\left(
\ind{\bool}(E, e_{0}, e_{1}, 0_{\bool}),
\ind{\bool}(E, e_{0}, e_{1}, 1_{\bool})
\right)
\equiv
( e_{0}, e_{1} )
\]%
by the computation rule for $\ind{\bool}$. For the other direction, suppose
that $f : \prd{b:\bool} E(b)$, so that once around the loop gives
$\ind{\bool}(E, f(0_{\bool}), f(1_{\bool}))$. Suppose that $b : \bool$. Then
there are two cases:
- $b \equiv 0_{\bool}$ gives $\ind{\bool}(E, f(0_{\bool}), f(1_{\bool}),
0_{\bool}) \equiv f(0_{\bool})$
- $b \equiv 1_{\bool}$ gives $\ind{\bool}(E, f(0_{\bool}), f(1_{\bool}),
1_{\bool}) \equiv f(1_{\bool})$
by the computational rule for $\ind{\bool}$. By function extensionality, then,
the result is equal to $f$.
*)
Definition Bool_rect_uncurried (E : Bool -> Type) :
(E false) * (E true) -> (forall b, E b).
intros p b. destruct b; [apply (snd p) | apply (fst p)].
Defined.
Definition Bool_rect_uncurried_inv (E : Bool -> Type) :
(forall b, E b) -> (E false) * (E true).
intro f. split; [apply (f false) | apply (f true)].
Defined.
Theorem ex5_4 `{Funext} (E : Bool -> Type) : IsEquiv (Bool_rect_uncurried E).
Proof.
refine (isequiv_adjointify _ (Bool_rect_uncurried_inv E) _ _);
unfold Bool_rect_uncurried, Bool_rect_uncurried_inv.
intro f. apply path_forall; intro b. destruct b; reflexivity.
intro p. apply eta_prod.
Qed.
(** %\exerdone{5.5}{175}%
Show that the analogous statement to Exercise 5.4 for $\N$ fails.
*)
(** %\soln%
The analogous statement is that
%\[
\ind{\N}(E) : \left(E(0) \times \prd{n:\N}E(n) \to E(\suc(n))\right)
\to
\prd{n:\N}E(n)
\]%
is an equivalence. To show that it fails, note that an element of the domain
is a recurrence $(e_{z}, e_{s})$. Recalling the solution to Exercise 5.3, we
have recurrences $(e_{z}, e_{s})$ and $(e'_{z}, e'_{s})$ such that $(e_{z},
e_{s}) \neq (e'_{z}, e'_{s})$, but such that $\ind{\N}(E, e_{z}, e_{s}) =
\ind{\N}(E, e'_{z}, e'_{s})$. Suppose for contradiction that
$\ind{\N}(E)$ has a quasi-inverse $\ind{\N}^{-1}(E)$. Then
%\[
(e_{z}, e_{s})
=
\ind{\N}^{-1}(E, \ind{\N}(E, e_{z}, e_{s}))
=
\ind{\N}^{-1}(E, \ind{\N}(E, e'_{z}, e'_{s}))
=
(e'_{z}, e'_{s})
\]%
The first and third equality are from the fact that a quasi-inverse is a left
inverse. The second comes from the fact that $\ind{\N}(E)$ sends the two
recurrences to the same function. So we have derived a contradiction.
*)
Definition nat_rect_uncurried (E : nat -> Type) :
(E O) * (forall n, E n -> E (S n)) -> forall n, E n.
intros p n. induction n. apply (fst p). apply (snd p). apply IHn.
Defined.
Theorem ex5_5 `{Funext} : ~ IsEquiv (nat_rect_uncurried (fun _ => Bool)).
Proof.
intro e. destruct e.
set (ez := (Ex3.ez Bool true)).
set (es := (Ex3.es Bool)).
set (ez' := (Ex3.ez' Bool true)).
set (es' := (Ex3.es' Bool true)).
assert ((ez, es) = (ez', es')) as H'.
transitivity (equiv_inv (nat_rect_uncurried (fun _ => Bool) (ez, es))).
symmetry. apply eissect.
transitivity (equiv_inv (nat_rect_uncurried (fun _ => Bool) (ez', es'))).
apply (ap equiv_inv). apply path_forall; intro n. induction n.
reflexivity.
simpl. rewrite IHn. unfold Ex3.es, Ex3.es'. induction n; reflexivity.
apply eissect.
assert (~ ((ez, es) = (ez', es'))) as nH.
apply (Ex3.ex5_3 Bool true false). apply true_ne_false.
contradiction nH.
Qed.
(** %\exer{5.6}{175}%
Show that if we assume simple instead of dependent elimination for $\w$-types,
the uniqueness property fails to hold. That is, exhibit a type satisfying the
recursion principle of a $\w$-type, but for which functions are not determined
uniquely by their recurrence.
*)
(** %\exerdone{5.7}{175}%
Suppose that in the ``inductive definition'' of the type $C$ at the beginning
of %\S5.6%, we replace the type $\N$ by $\emptyt$. Analogously to
5.6.1, we might consider a recursion principle for this type with hypothesis
%\[
h : (C \to \emptyt) \to (P \to \emptyt) \to P.
\]%
Show that even without a computation rule, this recursion principle is
inconsistent, %i.e.~it% allows us to construct an element of $\emptyt$.
*)
(** %\soln%
The constructor for $C$ is $g : (C \to \emptyt) \to C$, and the associated
recursion principle is
%\[
\rec{C} : \prd{P:\UU} ((C \to \emptyt) \to (P \to \emptyt) \to P) \to C \to P
\]%
Note first that the relevant recursion hypothesis can be constructed from $g$:
%\[
h
\defeq \lam{f:C \to \emptyt}{i:\emptyt \to \emptyt}f(g(f))
: ((C \to \emptyt) \to (\emptyt \to \emptyt) \to \emptyt) \to \emptyt
\]%
And so we have $\rec{C}(\emptyt, h) : C \to \emptyt$. But then
%\[
\rec{C}(\emptyt, h, g(\rec{C}(\emptyt, h))) : \emptyt
\]%
meaning that our recursion principle is inconsistent.
Alternatively, note that there is an equivalence
%\begin{align*}
(C \to \emptyt) \to (\emptyt \to \emptyt) \to \emptyt
&\eqvsym
(C \to \emptyt) \times (\emptyt \to \emptyt) \to \emptyt
\eqvsym
(C \to \emptyt) \times \unit \to \emptyt
\eqvsym
(C \to \emptyt) \to \emptyt
\equiv \lnot\lnot C
\end{align*}%
so the recursion principle says $\lnot\lnot C \to \lnot C$. By double negation
introduction composed with this we get $C \to \lnot C$. On the other hand, by
$g$ we have $\lnot C \to C$, and composing this with the recursion principle
gives $\lnot\lnot C \to C$. So $C$ is decidable, and in both cases we have a
contradiction because $C \to \lnot C$ and $\lnot C \to C$.
*)
Section Ex7.
Variable (C : Type) (g : (C -> Empty) -> C).
Variable (rec : forall P, ((C -> Empty) -> (P -> Empty) -> P) -> C -> P).
Theorem ex7 : Empty.
Proof.
set (h := (fun k i => k (g k)): ((C -> Empty) -> (Empty -> Empty) -> Empty)).
apply (rec Empty h).
apply g. apply (rec Empty h).
Defined.
End Ex7.
(** %\exerdone{5.8}{175}%
Consider now an ``inductive type'' $D$ with one constructor $\mathsf{scott} :
(D \to D) \to D$. The second recursor for $C$ suggested in %\S5.6% leads to
the following recursor for $D$:
%\[
\rec{D} : \prd{P:\UU} ((D \to D) \to (D \to P) \to P) \to D \to P
\]%
with computation rule $\rec{D}(P, h, \mathsf{scott}(\alpha)) \equiv h(\alpha,
(\lam{d}\rec{D}(P, h, \alpha(d))))$. Show that this also leads to a
contradiction.
*)
(** %\soln%
As in the previous problem, we can construct the recursion hypothesis from the
constructor:
%\[
h
\defeq \lam{f : D \to D}{g : D \to \emptyt}g(\mathsf{scott}(f))
: (D \to D) \to (D \to \emptyt) \to \emptyt
\]%
Then by $h(\idfunc{D})$ it suffices to give a function $D \to \emptyt$ to
construct an element of $\emptyt$, which we have in $\lam{d:D}\rec{D}(\emptyt,
h, d) : \emptyt$. So, putting it all together, we have
%\[
h(\idfunc{D}, \lam{d}\rec{D}(\emptyt, h, d))
\]%
which by the computation rule is judgementally equal to
%\[
\rec{D}(\emptyt, h, \mathsf{scott}(\idfunc{D})).
\]%
*)
Section Ex8.
Variable (D : Type) (scott : (D -> D) -> D).
Hypothesis (rec : forall P, ((D -> D) -> (D -> P) -> P) -> D -> P).
Theorem ex8 : Empty.
Proof.
set (h := (fun f g => g (scott f)) : (D -> D) -> (D -> Empty) -> Empty).
apply (h idmap). intro d.
apply (rec Empty h d).
Defined.
End Ex8.
(** %\exerdone{5.9}{176}%
Let $A$ be an arbitrary type and consider generally an ``inductive definition''
of a type $L_{A}$ with constructor $\mathsf{lawvere}:(L_{A} \to A) \to L_{A}$.
The second recursor for $C$ suggested in %\S5.6% leads to the following
recursor for $L_{A}$:
%\[
\rec{L_{A}} : \prd{P:\UU} ((L_{A} \to A) \to P) \to L_{A} \to P
\]%
with computation rule $\rec{L_{A}}(P, h, \mathsf{lawvere}(\alpha)) \equiv
h(\alpha)$. Using this, show that $A$ has a _fixed-point property_, %i.e.~for%
every function $f : A \to A$ there exists an $a : A$ such that $f(a) = a$. In
particular, $L_{A}$ is inconsistent if $A$ is a type without the fixed-point
property, such as $\emptyt$, $\bool$, $\N$.
*)
(** %\soln%
This is an instance of Lawvere's fixed-point theorem, which says that in a
cartesian closed category, if there is a point-surjective map $T \to A^{T}$,
then every endomorphism $f : A \to A$ has a fixed point. Working at an
intuitive level, the recursion principle ensures that we have the required
properties of a point-surjective map in a CCC. In particular, we have the map
$\phi : (L_{A} \to A) \to A^{L_{A} \to A}$ given by
%\[
\phi \defeq
\lam{f : L_{A} \to A}{\alpha : L_{A} \to A}f(\mathsf{lawvere}(\alpha))
\]%
and for any $h : A^{L_{A} \to A}$, we have
%\[
\phi(\rec{L_{A}}(A, h))
\equiv
\lam{\alpha : L_{A} \to A}\rec{L_{A}}(A, h, \mathsf{lawvere}(\alpha))
\equiv
\lam{\alpha : L_{A} \to A}h(\alpha)
=
h
\]%
So we can recap the proof of Lawvere's fixed-point theorem with this $\phi$.
Suppose that $f : A \to A$, and define
%\begin{align*}
q &\defeq \lam{\alpha:L_{A} \to A}f(\phi(\alpha, \alpha))
: (L_{A} \to A) \to A \\
p &\defeq \rec{L_{A}}(A, q)
: L_{A} \to A
\end{align*}%
so that $p$ lifts $q$:
%\[
\phi(p)
\equiv
\lam{\alpha : L_{A} \to A}\rec{L_{A}}(A, q, \mathsf{lawvere}(\alpha))
\equiv
\lam{\alpha : L_{A} \to A}q(\alpha)
=
q
\]%
This make $\phi(p, p)$ a fixed point of $f$:
%\[
f(\phi(p, p))
= (\lam{\alpha : L_{A} \to A}f(\phi(\alpha, \alpha)))(p)
= q(p)
= \phi(p, p)
\]%
*)
Definition onto {X Y} (f : X -> Y) := forall y : Y, {x : X & f x = y}.
Lemma LawvereFP {X Y} (phi : X -> (X -> Y)) :
onto phi -> forall (f : Y -> Y), {y : Y & f y = y}.
Proof.
intros Hphi f.
set (q := fun x => f (phi x x)).
set (p := Hphi q). destruct p as [p Hp].
exists (phi p p).
change (f (phi p p)) with ((fun x => f (phi x x)) p).
change (fun x => f (phi x x)) with q.
symmetry. apply (apD10 Hp).
Defined.
Module Ex9.
Section Ex9.
Variable (L A : Type).
Variable lawvere : (L -> A) -> L.
Variable rec : forall P, ((L -> A) -> P) -> L -> P.
Hypothesis rec_comp : forall P h alpha, rec P h (lawvere alpha) = h alpha.
Definition phi : (L -> A) -> ((L -> A) -> A) :=
fun f alpha => f (lawvere alpha).
Theorem ex5_9 `{Funext} : forall (f : A -> A), {a : A & f a = a}.
Proof.
intro f. apply (LawvereFP phi).
intro q. exists (rec A q). unfold phi.
change q with (fun alpha => q alpha).
apply path_forall; intro alpha. apply rec_comp.
Defined.
End Ex9.
End Ex9.
(** %\exerdone{5.10}{176}%
Continuing from Exercise 5.9, consider $L_{\unit}$, which is not obviously
inconsistent since $\unit$ does have the fixed-point property. Formulate an
induction principle for $L_{\unit}$ and its computation rule, analogously to
its recursor, and using this, prove that it is contractible.
*)
(** %\soln%
The induction principle for $L_{\unit}$ is
%\[
\ind{L_{\unit}}
: \prd{P : L_{\unit} \to \UU}
\left(\prd{\alpha : L_{\unit} \to \unit} P(\mathsf{lawvere}(\alpha))\right)
\to \prd{\ell : L_{\unit}}P(\ell)
\]%
and it has the computation rule
%\[
\ind{L_{\unit}}(P, f, \mathsf{lawvere}(\alpha)) \equiv f(\alpha)
\]%
for all $f : \prd{\alpha : L_{\unit} \to \unit} P(\mathsf{lawvere}(\alpha))$
and $\alpha : L_{\unit} \to \unit$.
Let ${!} : L_{\unit} \to \unit$ be the unique terminal arrow.
$L_{\unit}$ is contractible with center $\mathsf{lawvere}({!})$. By
$\ind{L_{\unit}}$, it suffices to show that $\mathsf{lawvere}({!}) =
\mathsf{lawvere}(\alpha)$ for any $\alpha : L_{\unit} \to \unit$. And by the
universal property of the terminal object, $\alpha = {!}$, so we're done.
*)
Module Ex10.
Section Ex10.
Variable L : Type.
Variable lawvere : (L -> Unit) -> L.
Variable indL : forall P, (forall alpha, P (lawvere alpha)) -> forall l, P l.
Hypothesis ind_comp : forall P f alpha, indL P f (lawvere alpha) = f alpha.
Theorem ex5_10 `{Funext} : Contr L.
Proof.
apply (BuildContr L (lawvere (fun _ => tt))).
apply indL; intro alpha.
apply (ap lawvere).
apply path_ishprop.
Defined.
End Ex10.
End Ex10.
(** %\exerdone{5.11}{176}%
In %\S5.1% we defined the type $\lst{A}$ of finite lists of elements of some
type $A$. Consider a similiar inductive definition of a type $\lost{A}$, whose
only constructor is
%\[
\cons : A \to \lost{A} \to \lost{A}.
\]%
Show that $\lost{A}$ is equivalent to $\emptyt$.
*)
(** %\soln%
Consider the recursor for $\lost{A}$, given by
%\[
\rec{\lost{A}} : \prd{P : \UU} (A \to \lost{A} \to P \to P) \to \lost{A} \to P
\]%
with computation rule
%\[
\rec{\lost{A}}(P, f, \cons(h, t)) \equiv f(h, \rec{\lost{A}}(P, f, t))
\]%
Now $\rec{\lost{A}}(\emptyt, \lam{a}{\ell}\idfunc{\emptyt}) : \lost{A} \to
\emptyt$, so $\lnot \lost{A}$ is inhabited, thus $\lost{A} \eqvsym \emptyt$.
*)
Theorem not_equiv_empty (A : Type) : ~ A -> (A <~> Empty).
Proof.
intro nA. refine (equiv_adjointify nA (Empty_rect (fun _ => A)) _ _);
intro; contradiction.
Defined.
Module Ex11.
Inductive lost (A : Type) := cons : A -> lost A -> lost A.
Theorem ex5_11 (A : Type) : lost A <~> Empty.
Proof.
apply not_equiv_empty.
intro l.
apply (lost_rect A). auto. apply l.
Defined.
End Ex11.
|
Require Import Algebra.Semigroup.
Require Import Algebra.Monoid.
Section GroupTheory.
Context {G: Set}(mult: G -> G -> G)(ident: G)(inv: G -> G).
Class Group := {
group_assoc: forall (a b c: G), mult (mult a b) c = mult a (mult b c);
group_ident_left: forall (a: G), mult ident a = a;
group_ident_right: forall (a: G), mult a ident = a;
group_inv_left: forall (a: G), mult (inv a) a = ident;
group_inv_right: forall (a: G), mult a (inv a) = ident;
}.
Theorem group_monoid:
Group -> Monoid mult ident.
Proof.
intros Ggroup.
constructor.
{ apply group_assoc. }
{ apply group_ident_left. }
{ apply group_ident_right. }
Qed.
Theorem group_semigroup:
Group -> Semigroup mult.
Proof.
intros Ggroup.
constructor.
apply group_assoc.
Qed.
Context `{Ggroup: Group}.
Lemma group_left_mult (a b: G):
a = b -> forall (c: G), mult c a = mult c b.
Proof.
intros <-;
reflexivity.
Qed.
Lemma group_right_mult (a b: G):
a = b -> forall (c: G), mult a c = mult b c.
Proof.
intros <-;
reflexivity.
Qed.
Theorem group_ident_unique (ident': G):
(forall (a: G), mult ident' a = a) ->
(forall (a: G), mult a ident' = a) ->
ident' = ident.
Proof.
intros Hlident' Hrident'.
rewrite <- (Hrident' ident).
rewrite <- (group_ident_left ident').
rewrite (group_ident_left (mult ident ident')).
reflexivity.
Qed.
Theorem group_idemp_ident (a: G):
mult a a = a ->
a = ident.
Proof.
intros Hidemp.
apply group_right_mult with (c := inv a) in Hidemp.
rewrite group_assoc in Hidemp.
rewrite group_inv_right in Hidemp.
rewrite group_ident_right in Hidemp.
assumption.
Qed.
Theorem group_left_cancel (a b c: G):
mult c a = mult c b -> a = b.
Proof.
intros Hcacb.
apply group_left_mult with (c := inv c) in Hcacb.
rewrite <- 2 group_assoc in Hcacb.
rewrite group_inv_left in Hcacb.
rewrite 2 group_ident_left in Hcacb.
assumption.
Qed.
Theorem group_right_cancel (a b c: G):
mult a c = mult b c -> a = b.
Proof.
intros Hacbc.
apply group_right_mult with (c := inv c) in Hacbc.
rewrite 2 group_assoc in Hacbc.
rewrite group_inv_right in Hacbc.
rewrite 2 group_ident_right in Hacbc.
assumption.
Qed.
Theorem group_inv_unique (a aInv: G):
mult aInv a = ident ->
mult a aInv = ident ->
aInv = inv a.
Proof.
intros Hlinv Hrinv.
rewrite <- (group_inv_right a) in Hrinv.
apply group_left_cancel in Hrinv.
assumption.
Qed.
Theorem group_inv_involute (a: G):
inv (inv a) = a.
Proof.
symmetry.
apply group_inv_unique.
{ apply group_inv_right. }
{ apply group_inv_left. }
Qed.
Theorem group_inv_mult (a b: G):
inv (mult a b) = mult (inv b) (inv a).
Proof.
symmetry.
apply group_inv_unique;
rewrite group_assoc.
{ remember (mult (inv a) (mult a b)) as b'.
rewrite <- group_assoc in Heqb'.
rewrite group_inv_left in Heqb'.
rewrite group_ident_left in Heqb'.
subst b'.
apply group_inv_left. }
{ remember (mult b (mult (inv b) (inv a))) as inva.
rewrite <- group_assoc in Heqinva.
rewrite group_inv_right in Heqinva.
rewrite group_ident_left in Heqinva.
subst inva.
apply group_inv_right. }
Qed.
Theorem group_left_mult_soln (a b: G):
exists! (x: G), mult a x = b.
Proof.
exists (mult (inv a) b).
split.
{ rewrite <- group_assoc.
rewrite group_inv_right.
rewrite group_ident_left.
reflexivity. }
{ intros x Haxb.
apply group_left_mult with (c := inv a) in Haxb.
rewrite <- group_assoc in Haxb.
rewrite group_inv_left in Haxb.
rewrite group_ident_left in Haxb.
symmetry.
assumption. }
Qed.
Theorem group_right_mult_soln (a b: G):
exists! (x: G), mult x a = b.
Proof.
exists (mult b (inv a)).
split.
{ rewrite group_assoc.
rewrite group_inv_left.
rewrite group_ident_right.
reflexivity. }
{ intros x Hxab.
apply group_right_mult with (c := inv a) in Hxab.
rewrite group_assoc in Hxab.
rewrite group_inv_right in Hxab.
rewrite group_ident_right in Hxab.
symmetry.
assumption. }
Qed.
Theorem group_inv_ident:
inv ident = ident.
Proof.
symmetry.
apply group_inv_unique;
apply group_ident_right.
Qed.
End GroupTheory.
Section SemigroupTheory.
Context {G: Set}(mult: G -> G -> G).
Context `{Gsubgroup: Semigroup G mult}.
Context (ident: G)(inv: G -> G).
Theorem group_semigroup_left_ident_left_inv:
(Monoid mult ident /\ Group mult ident inv) ->
forall (a: G), mult ident a = a /\ mult (inv a) a = ident.
Proof.
intros [Gmonoid Ggroup] a.
split;
[apply monoid_ident_left | apply group_inv_left];
assumption.
Qed.
Theorem group_semigroup_right_ident_right_inv:
(Monoid mult ident /\ Group mult ident inv) ->
forall (a: G), mult a ident = a /\ mult a (inv a) = ident.
Proof.
intros [Gmonoid Ggroup] a.
split;
[apply monoid_ident_right | apply group_inv_right];
assumption.
Qed.
Lemma semigroup_left_ident_left_inv_idemp_ident:
(forall (a: G), mult ident a = a) ->
(forall (a: G), mult (inv a) a = ident) ->
forall (a: G), mult a a = a -> a = ident.
Proof.
intros Hlident Hlinv a Hidemp.
apply semigroup_left_mult with (c := inv a)(mult0 := mult) in Hidemp.
rewrite <- semigroup_assoc in Hidemp;
try assumption.
rewrite Hlinv in Hidemp.
rewrite Hlident in Hidemp.
assumption.
Qed.
Lemma semigroup_right_ident_right_inv_idemp_ident:
(forall (a: G), mult a ident = a) ->
(forall (a: G), mult a (inv a) = ident) ->
forall (a: G), mult a a = a -> a = ident.
Proof.
intros Hrident Hrinv a Hidemp.
apply semigroup_right_mult with (c := inv a)(mult0 := mult) in Hidemp.
rewrite semigroup_assoc in Hidemp;
try assumption.
rewrite Hrinv in Hidemp.
rewrite Hrident in Hidemp.
assumption.
Qed.
Theorem semigroup_left_ident_left_inv_group:
(forall (a: G), mult ident a = a) ->
(forall (a: G), mult (inv a) a = ident) ->
Monoid mult ident /\ Group mult ident inv.
Proof.
intros Hlident Hlinv.
cut (forall (a: G), mult a (inv a) = ident).
{ intros Hrinv.
split;
constructor;
try apply semigroup_assoc;
try assumption;
intros a;
rewrite <- (Hlinv a);
rewrite <- semigroup_assoc;
try assumption;
rewrite Hrinv;
apply Hlident. }
{ intros a.
apply semigroup_left_ident_left_inv_idemp_ident;
try assumption.
rewrite semigroup_assoc;
try assumption.
remember (mult (inv a) (mult a (inv a))) as inva.
rewrite <- semigroup_assoc in Heqinva;
try assumption.
rewrite Hlinv in Heqinva.
rewrite Hlident in Heqinva.
subst inva.
reflexivity. }
Qed.
Theorem semigroup_right_ident_right_inv_group:
(forall (a: G), mult a ident = a) ->
(forall (a: G), mult a (inv a) = ident) ->
Monoid mult ident /\ Group mult ident inv.
Proof.
intros Hrident Hrinv.
cut (forall (a: G), mult (inv a) a = ident).
{ intros Hlinv.
split;
constructor;
try apply semigroup_assoc;
try assumption;
intros a;
rewrite <- (Hrinv a);
rewrite semigroup_assoc;
try assumption;
rewrite Hlinv;
rewrite Hrident;
reflexivity. }
{ intros a.
apply semigroup_right_ident_right_inv_idemp_ident;
try assumption.
rewrite <- semigroup_assoc;
try assumption.
remember (mult (mult (inv a) a) (inv a)) as inva.
rewrite semigroup_assoc in Heqinva;
try assumption.
rewrite Hrinv in Heqinva.
rewrite Hrident in Heqinva.
subst inva.
reflexivity. }
Qed.
End SemigroupTheory.
Section SubgroupTheory.
Context {G: Set}(mult: G -> G -> G)(ident: G)(inv: G -> G).
Context `{Gsubgroup: Semigroup G mult}.
Context `{Gmonoid: Monoid G mult ident}.
Context `{Ggroup: Group G mult ident inv}.
Context (P: G -> Prop).
Class Subgroup := {
subgroup_mult_closed: forall (a b: G), P a -> P b -> P (mult a b);
subgroup_ident: P ident;
subgroup_inv_closed: forall (a: G), P a -> P (inv a);
}.
Theorem subgroup_mult_inv_closed:
Subgroup ->
forall (a b: G), P a -> P b -> P (mult a (inv b)).
Proof.
intros Psubgroup a b Pa Pb.
apply subgroup_mult_closed;
try assumption.
apply subgroup_inv_closed;
assumption.
Qed.
Lemma subset_mult_inv_closed_ident:
{a: G | P a} ->
(forall (a b: G), P a -> P b -> P (mult a (inv b))) ->
P ident.
Proof.
intros [a Ha] Hmultinv.
rewrite <- (group_inv_right mult ident inv a).
apply Hmultinv;
assumption.
Qed.
Theorem subset_mult_inv_closed_subgroup:
{a: G | P a} ->
(forall (a b: G), P a -> P b -> P (mult a (inv b))) ->
Subgroup.
Proof.
intros [g Pg] Hmultinv.
constructor.
{ intros a b Pa Pb.
rewrite <- (group_inv_involute mult ident inv b).
apply Hmultinv;
try assumption.
rewrite <- (monoid_ident_left mult ident).
apply Hmultinv;
try assumption.
apply subset_mult_inv_closed_ident;
try exists g;
try assumption. }
{ apply subset_mult_inv_closed_ident;
try exists g;
try assumption. }
{ intros a Pa.
rewrite <- (monoid_ident_left mult ident).
apply Hmultinv;
try assumption.
apply subset_mult_inv_closed_ident;
try exists g;
try assumption. }
Qed.
End SubgroupTheory.
|
SUBROUTINE zmultu6 ( IFLTAB, LOCK, LFLUSH)
implicit none
C
C zmultu6 takes care of all multiple user access
C and loads in the permanent section of the file,
C when called to lock the file for a write request.
C It also dumps changed buffers to disk when an
C unlock request is made.
C
C This routine is always called at the beginning
C and end of every change to the DSS file.
C
C **** THIS ROUTINE IS SYSTEM DEPENDENT *****
C
C LOCK IS A FLAG TO INDICATE IF THE OPERATION IS
C TO BEGIN LOCK, OR HAS BEEN COMPLETED
C
C LOCK = TRUE, BEGIN WRITE REQUEST
C LOCK = FALSE, WRITE COMPLETE
C
C LFLUSH = TRUE, Force read of permanent section on Lock,
C and flush buffers on un-lock
C LFLUSH = FALSE, Only lock and un-lock file
C
C
C IF IFLTAB(KMULT) = 0, Exclusive open / Single user only mode
C (The file was opened so that no one else can access the file)
C IF IFLTAB(KMULT) = 1, Read only mode, but locks are supported
C (someone else can lock the file)
C IF IFLTAB(KMULT) = 2, Standard multi-user mode with locks
C IF IFLTAB(KMULT) = 3, Multi-user "advisory". This locks the
C file on the first write and only un-locks on close, or if
C someone else requests access (where the mode goes to 2).
C This is much faster if we might be the only one using the file.
C IF IFLTAB(KMULT) = 4, Exclusive access with locks for WRITING only
C IF IFLTAB(KMULT) = 5, Exclusive access with locks for both reading
C and writing. NOT ACTIVE!!!
C IF IFLTAB(KMULT) = 6, Release exclusive access (internal flag)
C
C IF IFLTAB(KLOCK) = 1, The file is currently not locked
C IF IFLTAB(KLOCK) = 2, The file is currently locked
C
C IFLTAB(KLOCKB) contains the first byte position of the
C record used in the file for locking
C The first word indicates the file is locked
C The second word is a request to lock the file (another
C program already has the file locked, and need to check
C this occasionally)
C The third word, when combined with the first two, indicate
C that the file is exclusively locked and is unaccessible
C to other programs until it is closed. This is used, for
C example, when a squeeze is going on. Other programs
C should generally gracefully exit.
C
C The MODE (second) argument for LOCKDSS is as follows:
C 0 - Unlock
C 1 - Lock. Wait if unavailable.
C 2 - Lock. Do not wait if unavailable.
C 3 - Test for lock. (Do not lock.)
C
C
C
LOGICAL LOCK, LFLUSH
INTEGER IFLTAB(*)
integer I,J,IADD,IERR,ISIZE,IUNIT,JERR,KERR,IWORD
integer*8 IBYTE
INCLUDE 'zdsskz.h'
C
INCLUDE 'zdssnz.h'
C
INCLUDE 'zdssmz.h'
C
INCLUDE 'zdsslz.h'
C
COMMON /WORDS/ IWORD(10)
C
C
C
C
IUNIT = IFLTAB(KUNIT)
IF (MLEVEL.GE.12) WRITE (MUNIT, 20) IUNIT, IFLTAB(KMULT),
* IFLTAB(KLOCK), LOCK, LFLUSH
20 FORMAT (T5,'----DSS--- DEBUG: Enter zmultu6; Unit:',I5,/,
* T12,'KMULT:',I3,', KLOCK:',I3,' LOCK: ',L1,' FLUSH:',L1)
C
C
C Check that this is a multiple user access file
IF (IFLTAB(KMULT).GT.1) THEN
C
IF (LOCK) THEN
C
C If the file has already been locked, ignore this request
C (this allows a smart program to lock and save buffers
C before zwrite6 does)
IF (IFLTAB(KLOCK).NE.2) THEN
C
C Only lock a small part of the file for DOS and unix
IF (IFLTAB(KMULT).EQ.4) THEN
C Exclusive lock - lock the lock record
ISIZE = IWORD(2) * 3
IBYTE = IFLTAB(KLOCKB)
CALL lockdss (IFLTAB(KHANDL), 2, IBYTE, ISIZE, IERR)
IF (IERR.NE.0) THEN
WRITE ( MUNIT, 30) IUNIT
30 FORMAT (/,' ----- DSS ERROR ----*',/
* ' Unable to lock file for Exclusive access. Unit: ',I5)
CALL zabort6 (IFLTAB, 210, 'zmultu6', IUNIT, IFLTAB(KLOCK),
* 'Can not EXCLUSIVELY lock file')
RETURN
ENDIF
ELSE
C
IBYTE = IFLTAB(KLOCKB)
CALL lockdss (IFLTAB(KHANDL), 2, IBYTE, IWORD(2), IERR)
ENDIF
C
C
C If we have an "advisory lock" (IFLTAB(KMULT) = 3), and cannot
C access the file because it is in use, place a lock request on
C the word following the locked word, and see if the other user
C will unlock the file (go to mode 2)
IF (IERR.NE.0) THEN
C
C Do a quick test to see if we have access to the file
C (Does someone else have the file in exclusive access mode?)
IBYTE = IFLTAB(KLOCKB) + (IWORD(2) * 2)
CALL lockdss (IFLTAB(KHANDL), 3, IBYTE, IWORD(2), JERR)
IF (JERR.NE.0) THEN
C Can not lock the exclusive access word. Be sure this
C is not just a fluke (someone else could be testing lock
C at the same time!
C DO 32 I=1,10 u
C CALL WAITS (1.0) u
C CALL lockdss (IFLTAB(KHANDL), 3, IBYTE, IWORD(2), JERR) u
C IF (JERR.EQ.0) GO TO 35 u
C32 CONTINUE u
CALL lockdss (IFLTAB(KHANDL), 1, IBYTE, IWORD(2), JERR) Md
CALL lockdss (IFLTAB(KHANDL), 0, IBYTE, IWORD(2), KERR) Md
IF (JERR.EQ.0) GO TO 35 Md
C We do not have access to lock this file!
WRITE ( MUNIT, 60) IUNIT
CALL zabort6 (IFLTAB, 210, 'zmultu6', IUNIT, IFLTAB(KLOCK),
* 'Can not lock file')
RETURN
ENDIF
C
35 CONTINUE
IF (IFLTAB(KMULT).EQ.3) THEN
IFLTAB(KMULT) = 2
IF (MLEVEL.GE.1) WRITE (MUNIT, 36) IFLTAB(KUNIT)
36 FORMAT(' -----DSS--- File set to multi-user access, unit:',
* I6)
ENDIF
IBYTE = IFLTAB(KLOCKB) + IWORD(2)
CALL lockdss (IFLTAB(KHANDL), 2, IBYTE, IWORD(2), JERR)
IF (JERR.EQ.0) IFLTAB(KLOCKR) = 1
C
C Now try to re-lock the original area until the other program
C releases it, or we time out (5 minutes!)
DO 50 I=1,30
C On MS Windows, this lock will wait up to 10 seconds
IBYTE = IFLTAB(KLOCKB)
CALL lockdss (IFLTAB(KHANDL), 1,IBYTE,
* IWORD(2), JERR)
IF (JERR.EQ.0) THEN
C Have a release and the file is locked!
C Leave the request area locked and move on (if locked).
GO TO 70
ELSE
C Write a message every 30 seconds
J = MOD (I, 3)
IF ((J.EQ.1).AND.(MLEVEL.GE.1)) WRITE (MUNIT, 40)
40 FORMAT (' -----DSS--- Waiting for file access...')
ENDIF
50 CONTINUE
C Hmmm. Failed lock. Error out
WRITE ( MUNIT, 60) IUNIT
60 FORMAT (//,' ***** DSS ERROR *****',/
* ' UNABLE TO LOCK FILE FOR MULTIPLE USER ACCESS; UNIT: ',I5)
CALL zabort6 (IFLTAB, 210, 'zmultu6', IUNIT, IFLTAB(KLOCK),
* 'Can not lock file')
RETURN
C
70 CONTINUE
C
C
ELSE
C Successful lock. Lock the request area just in case
C another program begins to access this file
IF (IFLTAB(KMULT).EQ.2) THEN
IBYTE = IFLTAB(KLOCKB) + IWORD(2)
CALL lockdss (IFLTAB(KHANDL), 2, IBYTE, IWORD(2), JERR)
IF (JERR.EQ.0) IFLTAB(KLOCKR) = 1
ENDIF
ENDIF
C
C On unix, we need to be compatiable with DSS versions prior to 6-K
C call oldLockDSS (IFLTAB(KHANDL), 1,IFLTAB(KLOCKB),IWORD(2), JERR) u
IFLTAB(KLOCK) = 2
IF (MLEVEL.GE.12) WRITE (MUNIT,*)'---DSS: File Locked'
C
C
C Read the permanent section of the file
C On Multiple users systems, be sure this is a
C phyical read (not just a buffer in memory)!!
IF (LFLUSH) THEN
IF (MLEVEL.GE.10) WRITE (MUNIT,*)'---DSS: zmultu6: Read Perm'
CALL zrdprm6 (IFLTAB, .TRUE.)
ENDIF
C
ENDIF
C
ELSE
C
C Unlock the file.
C
C
C If we are in an exclusive write lock mode, don't unlock file
IF ((IFLTAB(KWLOCK).NE.1).AND.(IFLTAB(KMULT).NE.4)) THEN
C
C First dump all buffers to disk
IF (LFLUSH) THEN
IF (MLEVEL.GE.10)WRITE(MUNIT,*)'---DSS: zmultu6: Dump Buffs'
CALL zbdump6 (IFLTAB, 1)
ENDIF
C
C If we have the request area locked, unlock it
IF (IFLTAB(KLOCKR).NE.0) THEN
IBYTE = IFLTAB(KLOCKB) + IWORD(2)
CALL lockdss (IFLTAB(KHANDL), 0, IBYTE, IWORD(2), JERR)
IFLTAB(KLOCKR) = 0
ENDIF
C
C For DOS, check that if un-lock request has been issued
IF (IFLTAB(KMULT).EQ.3) THEN
IBYTE = IFLTAB(KLOCKB) + IWORD(2)
CALL lockdss (IFLTAB(KHANDL), 3, IBYTE, IWORD(2), IERR)
IF (IERR.NE.0) IFLTAB(KMULT) = 2
ENDIF
C
C
IF ((IFLTAB(KLOCK).EQ.2).AND.(IFLTAB(KMULT).LE.2)) THEN Md
C Compatability for unix DSS versions prior to 6-K
C IF ((IFLTAB(KLOCK).EQ.2).AND.(IFLTAB(KMULT).LE.3)) THEN u
C
C Be sure buffers are written to disk!!
IF (LFLUSH) THEN
IF(MLEVEL.GE.11)WRITE(MUNIT,*)'---DSS: File Buffers Flushed'
CALL flushf (IFLTAB(KHANDL), IERR)
IF (IERR.EQ.-1) THEN
C If the network goes down, we will come here. Wait for
C a few seconds then try again.
CALL WAITS (5.0)
CALL flushf (IFLTAB(KHANDL), IERR)
ENDIF
IF ((IERR.NE.0).AND.(MLEVEL.GT.0)) WRITE (MUNIT,75) IUNIT,
* IERR
75 FORMAT (' ---DSS - Error: Unable to flush DSS file',
* ' to disk.',/,' Unit:',I5,' Code:',I5)
ENDIF
C
C On unix, we need to be compatiable with DSS versions prior to 6-K
C call oldLockDSS (IFLTAB(KHANDL), 0,IFLTAB(KLOCKB),IWORD(2), JERR) u
C
CALL lockdss (IFLTAB(KHANDL), 0,IFLTAB(KLOCKB),IWORD(2),IERR)
C
IFLTAB(KLOCK) = 1
IF (MLEVEL.GE.10) WRITE (MUNIT,*)'---DSS: File Unlocked'
C If we have an error unlocking, I don't know what to do!
IF ((IERR.NE.0).AND.(MLEVEL.GE.3)) THEN
WRITE ( MUNIT, 80) IUNIT, IERR
80 FORMAT (' ---DSS - Caution: Unable to unlock DSS file',
* ' for multiple user access.',/,' Unit:',I5,' Code:',I5)
ENDIF
ELSE IF (IFLTAB(KMULT).EQ.6) THEN
C Release exclusive access
IF (LFLUSH) THEN
IF(MLEVEL.GE.10)WRITE(MUNIT,*)'---DSS: zmultu6: Dump Buffs'
CALL zbdump6 (IFLTAB, 1)
CALL flushf (IFLTAB(KHANDL), IERR)
ENDIF
ISIZE = IWORD(2) * 3
CALL lockdss (IFLTAB(KHANDL), 0, IFLTAB(KLOCKB), ISIZE, IERR)
IFLTAB(KLOCK) = 1
ENDIF
ENDIF
ENDIF
C
C
C
ELSE
C
IF (LOCK) THEN
IF (IFLTAB(KLOCK).NE.2) THEN
IFLTAB(KLOCK) = 2
C
C Read the permanent section of the file (Always!)
C Don't need to force (not multi-user)
IF (LFLUSH) THEN
IF (MLEVEL.GE.10) WRITE (MUNIT,*)'---DSS: zmultu6: Read Perm'
IADD = 1
CALL zgtrec6 (IFLTAB, IFLTAB(KPERM), NPERM, IADD, .TRUE.)
ENDIF
ENDIF
C
ELSE
IF (LFLUSH) THEN
IF (MLEVEL.GE.10) WRITE(MUNIT,*)'---DSS: zmultu6: Dump Buffs'
CALL zbdump6 (IFLTAB, 1)
ENDIF
IFLTAB(KLOCK) = 1
ENDIF
C
ENDIF
C
IF (MLEVEL.GE.12) WRITE (MUNIT, 120) IUNIT, IFLTAB(KMULT),
* IFLTAB(KLOCK), LOCK
120 FORMAT (T5,'----DSS--- DEBUG: Exit zmultu6; Unit:',I5,/,
* T12,'KMULT:',I3,', KLOCK:',I3,' LOCK: ',L1)
C
RETURN
END
C subroutine oldLockDSS (ihandle, mode, position, size, istat) u
c
C integer ihandle, mode, position, size, istat u
C integer oldPosition u
c
c Compatability for versions of dss prior to 6-K
c
C irec = position / 512 u
C ibyte = position - (irec * 512) u
C oldPosition = (irec * 127) + 1 + ibyte u
c
C call lockdss (ihandle, mode, oldPosition, size, istat) u
c
C return u
C end u
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.