[GOAL]
X : TopCat
F : Presheaf (Type v) X
U U' : (Opens ↑X)ᵒᵖ
f : U ⟶ U'
⊢ F.map f ≫
      (fun U f =>
          { val := fun x => germ F x f,
            property :=
              (_ :
                PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate fun x =>
                  germ F x f) })
        U' =
    (fun U f =>
          { val := fun x => germ F x f,
            property :=
              (_ :
                PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate fun x =>
                  germ F x f) })
        U ≫
      (sheafify F).val.map f
[PROOFSTEP]
ext x
[GOAL]
case h
X : TopCat
F : Presheaf (Type v) X
U U' : (Opens ↑X)ᵒᵖ
f : U ⟶ U'
x : F.obj U
⊢ (F.map f ≫
        (fun U f =>
            { val := fun x => germ F x f,
              property :=
                (_ :
                  PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate fun x =>
                    germ F x f) })
          U')
      x =
    ((fun U f =>
            { val := fun x => germ F x f,
              property :=
                (_ :
                  PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate fun x =>
                    germ F x f) })
          U ≫
        (sheafify F).val.map f)
      x
[PROOFSTEP]
apply Subtype.ext
[GOAL]
case h.a
X : TopCat
F : Presheaf (Type v) X
U U' : (Opens ↑X)ᵒᵖ
f : U ⟶ U'
x : F.obj U
⊢ ↑((F.map f ≫
          (fun U f =>
              { val := fun x => germ F x f,
                property :=
                  (_ :
                    PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate fun x =>
                      germ F x f) })
            U')
        x) =
    ↑(((fun U f =>
              { val := fun x => germ F x f,
                property :=
                  (_ :
                    PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate fun x =>
                      germ F x f) })
            U ≫
          (sheafify F).val.map f)
        x)
[PROOFSTEP]
ext ⟨u, m⟩
[GOAL]
case h.a.h.mk
X : TopCat
F : Presheaf (Type v) X
U U' : (Opens ↑X)ᵒᵖ
f : U ⟶ U'
x : F.obj U
u : ↑X
m : u ∈ U'.unop
⊢ ↑((F.map f ≫
            (fun U f =>
                { val := fun x => germ F x f,
                  property :=
                    (_ :
                      PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate
                        fun x => germ F x f) })
              U')
          x)
      { val := u, property := m } =
    ↑(((fun U f =>
                { val := fun x => germ F x f,
                  property :=
                    (_ :
                      PrelocalPredicate.pred (PrelocalPredicate.sheafify (Sheafify.isGerm F)).toPrelocalPredicate
                        fun x => germ F x f) })
              U ≫
            (sheafify F).val.map f)
          x)
      { val := u, property := m }
[PROOFSTEP]
exact germ_res_apply F f.unop ⟨u, m⟩ x
[GOAL]
X : TopCat
F : Presheaf (Type v) X
x : ↑X
⊢ Function.Surjective (stalkToFiber F x)
[PROOFSTEP]
apply TopCat.stalkToFiber_surjective
[GOAL]
case w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
⊢ ∀ (t : stalk F x), ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t
[PROOFSTEP]
intro t
[GOAL]
case w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
t : stalk F x
⊢ ∃ U f x_1, f { val := x, property := (_ : x ∈ U.obj) } = t
[PROOFSTEP]
obtain ⟨U, m, s, rfl⟩ := F.germ_exist _ t
[GOAL]
case w.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (forget (Type v)).obj (F.obj (op U))
⊢ ∃ U_1 f x_1, f { val := x, property := (_ : x ∈ U_1.obj) } = ↑(germ F { val := x, property := m }) s
[PROOFSTEP]
use⟨U, m⟩
[GOAL]
case h
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (forget (Type v)).obj (F.obj (op U))
⊢ ∃ f x_1,
    f { val := x, property := (_ : x ∈ { obj := U, property := m }.obj) } = ↑(germ F { val := x, property := m }) s
[PROOFSTEP]
fconstructor
[GOAL]
case h.w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (forget (Type v)).obj (F.obj (op U))
⊢ (y : { x_1 // x_1 ∈ { obj := U, property := m }.obj }) → stalk F ↑y
[PROOFSTEP]
exact fun y => F.germ y s
[GOAL]
case h.h
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U : Opens ↑X
m : x ∈ U
s : (forget (Type v)).obj (F.obj (op U))
⊢ ∃ x_1,
    germ F { val := x, property := (_ : x ∈ { obj := U, property := m }.obj) } s =
      ↑(germ F { val := x, property := m }) s
[PROOFSTEP]
exact ⟨PrelocalPredicate.sheafifyOf ⟨s, fun _ => rfl⟩, rfl⟩
[GOAL]
X : TopCat
F : Presheaf (Type v) X
x : ↑X
⊢ Function.Injective (stalkToFiber F x)
[PROOFSTEP]
apply TopCat.stalkToFiber_injective
[GOAL]
case w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
⊢ ∀ (U V : OpenNhds x) (fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y),
    PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU →
      ∀ (fV : (y : { x_2 // x_2 ∈ V.obj }) → stalk F ↑y),
        PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV →
          fU { val := x, property := (_ : x ∈ U.obj) } = fV { val := x, property := (_ : x ∈ V.obj) } →
            ∃ W iU iV,
              ∀ (w : { x_4 // x_4 ∈ W.obj }),
                fU ((fun x_4 => { val := ↑x_4, property := (_ : ↑x_4 ∈ ↑U.obj) }) w) =
                  fV ((fun x_4 => { val := ↑x_4, property := (_ : ↑x_4 ∈ ↑V.obj) }) w)
[PROOFSTEP]
intro U V fU hU fV hV e
[GOAL]
case w
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
e : fU { val := x, property := (_ : x ∈ U.obj) } = fV { val := x, property := (_ : x ∈ V.obj) }
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
rcases hU ⟨x, U.2⟩ with ⟨U', mU, iU, gU, wU⟩
[GOAL]
case w.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
e : fU { val := x, property := (_ : x ∈ U.obj) } = fV { val := x, property := (_ : x ∈ V.obj) }
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
rcases hV ⟨x, V.2⟩ with ⟨V', mV, iV, gV, wV⟩
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
e : fU { val := x, property := (_ : x ∈ U.obj) } = fV { val := x, property := (_ : x ∈ V.obj) }
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
have wUx := wU ⟨x, mU⟩
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
e : fU { val := x, property := (_ : x ∈ U.obj) } = fV { val := x, property := (_ : x ∈ V.obj) }
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
wUx :
  (fun x_1 => fU ((fun x_2 => { val := ↑x_2, property := (_ : ↑x_2 ∈ ↑U.obj) }) x_1)) { val := x, property := mU } =
    germ F { val := x, property := mU } gU
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
dsimp at wUx
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
e : fU { val := x, property := (_ : x ∈ U.obj) } = fV { val := x, property := (_ : x ∈ V.obj) }
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
wUx : fU { val := x, property := (_ : ↑{ val := x, property := mU } ∈ ↑U.obj) } = germ F { val := x, property := mU } gU
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
erw [wUx] at e
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
e : germ F { val := x, property := mU } gU = fV { val := x, property := (_ : x ∈ V.obj) }
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
wUx : fU { val := x, property := (_ : ↑{ val := x, property := mU } ∈ ↑U.obj) } = germ F { val := x, property := mU } gU
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
clear wUx
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
e : germ F { val := x, property := mU } gU = fV { val := x, property := (_ : x ∈ V.obj) }
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
have wVx := wV ⟨x, mV⟩
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
e : germ F { val := x, property := mU } gU = fV { val := x, property := (_ : x ∈ V.obj) }
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
wVx :
  (fun x_1 => fV ((fun x_2 => { val := ↑x_2, property := (_ : ↑x_2 ∈ ↑V.obj) }) x_1)) { val := x, property := mV } =
    germ F { val := x, property := mV } gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
dsimp at wVx
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
e : germ F { val := x, property := mU } gU = fV { val := x, property := (_ : x ∈ V.obj) }
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
wVx : fV { val := x, property := (_ : ↑{ val := x, property := mV } ∈ ↑V.obj) } = germ F { val := x, property := mV } gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
erw [wVx] at e
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
wVx : fV { val := x, property := (_ : ↑{ val := x, property := mV } ∈ ↑V.obj) } = germ F { val := x, property := mV } gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
clear wVx
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
rcases F.germ_eq x mU mV gU gV e with ⟨W, mW, iU', iV', (e' : F.map iU'.op gU = F.map iV'.op gV)⟩
[GOAL]
case w.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ ∃ W iU iV,
    ∀ (w : { x_1 // x_1 ∈ W.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
use⟨W ⊓ (U' ⊓ V'), ⟨mW, mU, mV⟩⟩
[GOAL]
case h
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ ∃ iU iV,
    ∀ (w : { x_1 // x_1 ∈ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) }.obj }),
      fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
        fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
refine' ⟨_, _, _⟩
[GOAL]
case h.refine'_1
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) } ⟶ U
[PROOFSTEP]
change W ⊓ (U' ⊓ V') ⟶ U.obj
[GOAL]
case h.refine'_1
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ W ⊓ (U' ⊓ V') ⟶ U.obj
[PROOFSTEP]
exact Opens.infLERight _ _ ≫ Opens.infLELeft _ _ ≫ iU
[GOAL]
case h.refine'_2
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) } ⟶ V
[PROOFSTEP]
change W ⊓ (U' ⊓ V') ⟶ V.obj
[GOAL]
case h.refine'_2
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ W ⊓ (U' ⊓ V') ⟶ V.obj
[PROOFSTEP]
exact Opens.infLERight _ _ ≫ Opens.infLERight _ _ ≫ iV
[GOAL]
case h.refine'_3
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
⊢ ∀ (w : { x_1 // x_1 ∈ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) }.obj }),
    fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
      fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
intro w
[GOAL]
case h.refine'_3
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
wU :
  ∀ (x_1 : { x // x ∈ U' }),
    (fun x_2 => fU ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑U.obj) }) x_2)) x_1 = germ F x_1 gU
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
w : { x_1 // x_1 ∈ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) }.obj }
⊢ fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
    fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
specialize wU ⟨w.1, w.2.2.1⟩
[GOAL]
case h.refine'_3
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
wV :
  ∀ (x_1 : { x // x ∈ V' }),
    (fun x_2 => fV ((fun x_3 => { val := ↑x_3, property := (_ : ↑x_3 ∈ ↑V.obj) }) x_2)) x_1 = germ F x_1 gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
w : { x_1 // x_1 ∈ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) }.obj }
wU :
  (fun x_1 => fU ((fun x_2 => { val := ↑x_2, property := (_ : ↑x_2 ∈ ↑U.obj) }) x_1))
      { val := ↑w, property := (_ : ↑w ∈ ↑U') } =
    germ F { val := ↑w, property := (_ : ↑w ∈ ↑U') } gU
⊢ fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
    fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
specialize wV ⟨w.1, w.2.2.2⟩
[GOAL]
case h.refine'_3
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
w : { x_1 // x_1 ∈ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) }.obj }
wU :
  (fun x_1 => fU ((fun x_2 => { val := ↑x_2, property := (_ : ↑x_2 ∈ ↑U.obj) }) x_1))
      { val := ↑w, property := (_ : ↑w ∈ ↑U') } =
    germ F { val := ↑w, property := (_ : ↑w ∈ ↑U') } gU
wV :
  (fun x_1 => fV ((fun x_2 => { val := ↑x_2, property := (_ : ↑x_2 ∈ ↑V.obj) }) x_1))
      { val := ↑w, property := (_ : ↑w ∈ ↑V') } =
    germ F { val := ↑w, property := (_ : ↑w ∈ ↑V') } gV
⊢ fU ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑U.obj) }) w) =
    fV ((fun x_1 => { val := ↑x_1, property := (_ : ↑x_1 ∈ ↑V.obj) }) w)
[PROOFSTEP]
dsimp at wU wV ⊢
[GOAL]
case h.refine'_3
X : TopCat
F : Presheaf (Type v) X
x : ↑X
U V : OpenNhds x
fU : (y : { x_1 // x_1 ∈ U.obj }) → stalk F ↑y
hU : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fU
fV : (y : { x_1 // x_1 ∈ V.obj }) → stalk F ↑y
hV : PrelocalPredicate.pred (Sheafify.isLocallyGerm F).toPrelocalPredicate fV
U' : Opens ↑X
mU : ↑{ val := x, property := (_ : x ∈ U.obj) } ∈ U'
iU : U' ⟶ U.obj
gU : F.obj (op U')
V' : Opens ↑X
mV : ↑{ val := x, property := (_ : x ∈ V.obj) } ∈ V'
iV : V' ⟶ V.obj
gV : F.obj (op V')
e : germ F { val := x, property := mU } gU = germ F { val := x, property := mV } gV
W : Opens ↑X
mW : x ∈ W
iU' : W ⟶ U'
iV' : W ⟶ V'
e' : F.map iU'.op gU = F.map iV'.op gV
w : { x_1 // x_1 ∈ { obj := W ⊓ (U' ⊓ V'), property := (_ : x ∈ ↑W ∧ x ∈ ↑(U' ⊓ V')) }.obj }
wU :
  fU { val := ↑w, property := (_ : ↑{ val := ↑w, property := (_ : ↑w ∈ ↑U') } ∈ ↑U.obj) } =
    germ F { val := ↑w, property := (_ : ↑w ∈ ↑U') } gU
wV :
  fV { val := ↑w, property := (_ : ↑{ val := ↑w, property := (_ : ↑w ∈ ↑V') } ∈ ↑V.obj) } =
    germ F { val := ↑w, property := (_ : ↑w ∈ ↑V') } gV
⊢ fU { val := ↑w, property := (_ : ↑w ∈ ↑U.obj) } = fV { val := ↑w, property := (_ : ↑w ∈ ↑V.obj) }
[PROOFSTEP]
erw [wU, ← F.germ_res iU' ⟨w, w.2.1⟩, wV, ← F.germ_res iV' ⟨w, w.2.1⟩, CategoryTheory.types_comp_apply,
  CategoryTheory.types_comp_apply, e']


[GOAL]
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder α
x✝ : α × β
a : α
b : β
⊢ ∃ b_1, (a, b) < b_1
[PROOFSTEP]
obtain ⟨c, h⟩ := exists_gt a
[GOAL]
case intro
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder α
x✝ : α × β
a : α
b : β
c : α
h : a < c
⊢ ∃ b_1, (a, b) < b_1
[PROOFSTEP]
exact ⟨(c, b), Prod.mk_lt_mk_iff_left.2 h⟩
[GOAL]
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder β
x✝ : α × β
a : α
b : β
⊢ ∃ b_1, (a, b) < b_1
[PROOFSTEP]
obtain ⟨c, h⟩ := exists_gt b
[GOAL]
case intro
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder β
x✝ : α × β
a : α
b c : β
h : b < c
⊢ ∃ b_1, (a, b) < b_1
[PROOFSTEP]
exact ⟨(a, c), Prod.mk_lt_mk_iff_right.2 h⟩
[GOAL]
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMinOrder α
x✝ : α × β
a : α
b : β
⊢ ∃ b_1, b_1 < (a, b)
[PROOFSTEP]
obtain ⟨c, h⟩ := exists_lt a
[GOAL]
case intro
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMinOrder α
x✝ : α × β
a : α
b : β
c : α
h : c < a
⊢ ∃ b_1, b_1 < (a, b)
[PROOFSTEP]
exact ⟨(c, b), Prod.mk_lt_mk_iff_left.2 h⟩
[GOAL]
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMinOrder β
x✝ : α × β
a : α
b : β
⊢ ∃ b_1, b_1 < (a, b)
[PROOFSTEP]
obtain ⟨c, h⟩ := exists_lt b
[GOAL]
case intro
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
inst✝ : NoMinOrder β
x✝ : α × β
a : α
b c : β
h : c < b
⊢ ∃ b_1, b_1 < (a, b)
[PROOFSTEP]
exact ⟨(a, c), Prod.mk_lt_mk_iff_right.2 h⟩
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u
π : ι → Type u_3
inst✝² : Nonempty ι
inst✝¹ : (i : ι) → Preorder (π i)
inst✝ : ∀ (i : ι), NoMaxOrder (π i)
a : (i : ι) → π i
⊢ ∃ b, a < b
[PROOFSTEP]
classical
obtain ⟨b, hb⟩ := exists_gt (a <| Classical.arbitrary _)
exact ⟨_, lt_update_self_iff.2 hb⟩
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u
π : ι → Type u_3
inst✝² : Nonempty ι
inst✝¹ : (i : ι) → Preorder (π i)
inst✝ : ∀ (i : ι), NoMaxOrder (π i)
a : (i : ι) → π i
⊢ ∃ b, a < b
[PROOFSTEP]
obtain ⟨b, hb⟩ := exists_gt (a <| Classical.arbitrary _)
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι : Type u
π : ι → Type u_3
inst✝² : Nonempty ι
inst✝¹ : (i : ι) → Preorder (π i)
inst✝ : ∀ (i : ι), NoMaxOrder (π i)
a : (i : ι) → π i
b : π (Classical.arbitrary ι)
hb : a (Classical.arbitrary ι) < b
⊢ ∃ b, a < b
[PROOFSTEP]
exact ⟨_, lt_update_self_iff.2 hb⟩
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u
π : ι → Type u_3
inst✝² : Nonempty ι
inst✝¹ : (i : ι) → Preorder (π i)
inst✝ : ∀ (i : ι), NoMinOrder (π i)
a : (i : ι) → π i
⊢ ∃ b, b < a
[PROOFSTEP]
classical
obtain ⟨b, hb⟩ := exists_lt (a <| Classical.arbitrary _)
exact ⟨_, update_lt_self_iff.2 hb⟩
[GOAL]
α : Type u_1
β : Type u_2
ι : Type u
π : ι → Type u_3
inst✝² : Nonempty ι
inst✝¹ : (i : ι) → Preorder (π i)
inst✝ : ∀ (i : ι), NoMinOrder (π i)
a : (i : ι) → π i
⊢ ∃ b, b < a
[PROOFSTEP]
obtain ⟨b, hb⟩ := exists_lt (a <| Classical.arbitrary _)
[GOAL]
case intro
α : Type u_1
β : Type u_2
ι : Type u
π : ι → Type u_3
inst✝² : Nonempty ι
inst✝¹ : (i : ι) → Preorder (π i)
inst✝ : ∀ (i : ι), NoMinOrder (π i)
a : (i : ι) → π i
b : π (Classical.arbitrary ι)
hb : b < a (Classical.arbitrary ι)
⊢ ∃ b, b < a
[PROOFSTEP]
exact ⟨_, update_lt_self_iff.2 hb⟩
[GOAL]
α✝ : Type u_1
β : Type u_2
α : Type u_3
inst✝¹ : LinearOrder α
inst✝ : NoBotOrder α
a : α
⊢ ∃ b, b < a
[PROOFSTEP]
simpa [not_le] using exists_not_ge a
[GOAL]
α✝ : Type u_1
β : Type u_2
α : Type u_3
inst✝¹ : LinearOrder α
inst✝ : NoTopOrder α
a : α
⊢ ∃ b, a < b
[PROOFSTEP]
simpa [not_le] using exists_not_le a
[GOAL]
α : Type u_1
β : Type u_2
inst✝ : Preorder α
a b : α
⊢ ¬IsMin a ↔ ∃ b, b < a
[PROOFSTEP]
simp [lt_iff_le_not_le, IsMin, not_forall, exists_prop]
[GOAL]
α : Type u_1
β : Type u_2
inst✝ : Preorder α
a b : α
⊢ ¬IsMax a ↔ ∃ b, a < b
[PROOFSTEP]
simp [lt_iff_le_not_le, IsMax, not_forall, exists_prop]


[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
⊢ Injective fun f => f.toFun
[PROOFSTEP]
rintro ⟨f, hf⟩ ⟨g, hg⟩ h
[GOAL]
case mk.mk
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ↪r s
hf : ∀ (a : α) (b : β), s b (↑f a) → ∃ a', ↑f a' = b
g : r ↪r s
hg : ∀ (a : α) (b : β), s b (↑g a) → ∃ a', ↑g a' = b
h : (fun f => f.toFun) { toRelEmbedding := f, init' := hf } = (fun f => f.toFun) { toRelEmbedding := g, init' := hg }
⊢ { toRelEmbedding := f, init' := hf } = { toRelEmbedding := g, init' := hg }
[PROOFSTEP]
congr with x
[GOAL]
case mk.mk.e_toRelEmbedding.h
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ↪r s
hf : ∀ (a : α) (b : β), s b (↑f a) → ∃ a', ↑f a' = b
g : r ↪r s
hg : ∀ (a : α) (b : β), s b (↑g a) → ∃ a', ↑g a' = b
h : (fun f => f.toFun) { toRelEmbedding := f, init' := hf } = (fun f => f.toFun) { toRelEmbedding := g, init' := hg }
x : α
⊢ ↑f x = ↑g x
[PROOFSTEP]
exact congr_fun h x
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
a : α
b : β
h : s b (↑f a)
⊢ ∃ a', ↑f a' = b ∧ r a' a
[PROOFSTEP]
rcases f.init h with ⟨a', rfl⟩
[GOAL]
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
a a' : α
h : s (↑f a') (↑f a)
⊢ ∃ a'_1, ↑f a'_1 = ↑f a' ∧ r a'_1 a
[PROOFSTEP]
exact ⟨a', rfl, f.map_rel_iff.1 h⟩
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
g : s ≼i t
a : α
c : γ
h : t c (↑(RelEmbedding.trans f.toRelEmbedding g.toRelEmbedding) a)
⊢ ∃ a', ↑(RelEmbedding.trans f.toRelEmbedding g.toRelEmbedding) a' = c
[PROOFSTEP]
simp at h ⊢
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
g : s ≼i t
a : α
c : γ
h : t c (↑g (↑f a))
⊢ ∃ a', ↑g (↑f a') = c
[PROOFSTEP]
rcases g.2 _ _ h with ⟨b, rfl⟩
[GOAL]
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
g : s ≼i t
a : α
b : β
h : t (↑g.toRelEmbedding b) (↑g (↑f a))
⊢ ∃ a', ↑g (↑f a') = ↑g.toRelEmbedding b
[PROOFSTEP]
have h := g.map_rel_iff.1 h
[GOAL]
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
g : s ≼i t
a : α
b : β
h✝ : t (↑g.toRelEmbedding b) (↑g (↑f a))
h : s b (↑f a)
⊢ ∃ a', ↑g (↑f a') = ↑g.toRelEmbedding b
[PROOFSTEP]
rcases f.2 _ _ h with ⟨a', rfl⟩
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
g : s ≼i t
a a' : α
h✝ : t (↑g.toRelEmbedding (↑f.toRelEmbedding a')) (↑g (↑f a))
h : s (↑f.toRelEmbedding a') (↑f a)
⊢ ∃ a'_1, ↑g (↑f a'_1) = ↑g.toRelEmbedding (↑f.toRelEmbedding a')
[PROOFSTEP]
exact ⟨a', rfl⟩
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝² : IsTrichotomous β s
inst✝¹ : IsIrrefl β s
inst✝ : IsWellFounded α r
f g : r ≼i s
⊢ f = g
[PROOFSTEP]
ext a
[GOAL]
case h
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝² : IsTrichotomous β s
inst✝¹ : IsIrrefl β s
inst✝ : IsWellFounded α r
f g : r ≼i s
a : α
⊢ ↑f a = ↑g a
[PROOFSTEP]
refine' IsWellFounded.induction r a fun b IH => extensional_of_trichotomous_of_irrefl s fun x => _
[GOAL]
case h
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝² : IsTrichotomous β s
inst✝¹ : IsIrrefl β s
inst✝ : IsWellFounded α r
f g : r ≼i s
a b : α
IH : ∀ (y : α), r y b → ↑f y = ↑g y
x : β
⊢ s x (↑f b) ↔ s x (↑g b)
[PROOFSTEP]
rw [f.init_iff, g.init_iff]
[GOAL]
case h
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝² : IsTrichotomous β s
inst✝¹ : IsIrrefl β s
inst✝ : IsWellFounded α r
f g : r ≼i s
a b : α
IH : ∀ (y : α), r y b → ↑f y = ↑g y
x : β
⊢ (∃ a', ↑f a' = x ∧ r a' b) ↔ ∃ a', ↑g a' = x ∧ r a' b
[PROOFSTEP]
exact exists_congr fun x => and_congr_left fun hx => IH _ hx ▸ Iff.rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
a : r ≼i s
⊢ ∀ (b : r ≼i s), a = b
[PROOFSTEP]
let _ := a.isWellFounded
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
a : r ≼i s
x✝ : IsWellFounded α r := RelEmbedding.isWellFounded a.toRelEmbedding
⊢ ∀ (b : r ≼i s), a = b
[PROOFSTEP]
exact Subsingleton.elim a
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≼i s
a : α
⊢ ↑f a = ↑g a
[PROOFSTEP]
rw [Subsingleton.elim f g]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ≼i s
h : ¬∃ b, ∀ (x : β), s x b ↔ ∃ y, ↑f y = x
b x : β
x✝¹ : ∀ (y : β), s y x → Acc s y
IH : ∀ (y : β), s y x → ∃ a, ↑f a = y
hn : ∀ (x_1 : α), ¬↑f x_1 = x
y : β
x✝ : ∃ y_1, ↑f y_1 = y
a : α
e : ↑f a = y
⊢ s y x
[PROOFSTEP]
rw [← e]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ≼i s
h : ¬∃ b, ∀ (x : β), s x b ↔ ∃ y, ↑f y = x
b x : β
x✝¹ : ∀ (y : β), s y x → Acc s y
IH : ∀ (y : β), s y x → ∃ a, ↑f a = y
hn : ∀ (x_1 : α), ¬↑f x_1 = x
y : β
x✝ : ∃ y_1, ↑f y_1 = y
a : α
e : ↑f a = y
⊢ s (↑f a) x
[PROOFSTEP]
exact (trichotomous _ _).resolve_right (not_or_of_not (hn a) fun hl => not_exists.2 hn (f.init hl))
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
p : Set β
f : r ≼i s
H : ∀ (a : α), ↑f a ∈ p
a : α
x✝ : ↑p
b : β
m : b ∈ p
h : Subrel s p { val := b, property := m } (↑(RelEmbedding.codRestrict p f.toRelEmbedding H) a)
a' : α
e : ↑f a' = ↑{ val := b, property := m }
⊢ ↑(RelEmbedding.codRestrict p f.toRelEmbedding H) a' = { val := b, property := m }
[PROOFSTEP]
subst e
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
p : Set β
f : r ≼i s
H : ∀ (a : α), ↑f a ∈ p
a : α
x✝ : ↑p
a' : α
m : ↑f a' ∈ p
h : Subrel s p { val := ↑f a', property := m } (↑(RelEmbedding.codRestrict p f.toRelEmbedding H) a)
⊢ ↑(RelEmbedding.codRestrict p f.toRelEmbedding H) a' = { val := ↑f a', property := m }
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
a : α
b : α ⊕ β
⊢ Sum.Lex r s b
      (↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
            map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
        a) →
    ∃ a',
      ↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
              map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
          a' =
        b
[PROOFSTEP]
cases b <;> [exact fun _ => ⟨_, rfl⟩; exact False.elim ∘ Sum.lex_inr_inl]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
a : α
b : α ⊕ β
⊢ Sum.Lex r s b
      (↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
            map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
        a) →
    ∃ a',
      ↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
              map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
          a' =
        b
[PROOFSTEP]
cases b
[GOAL]
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
a val✝ : α
⊢ Sum.Lex r s (Sum.inl val✝)
      (↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
            map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
        a) →
    ∃ a',
      ↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
              map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
          a' =
        Sum.inl val✝
[PROOFSTEP]
exact fun _ => ⟨_, rfl⟩
[GOAL]
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
a : α
val✝ : β
⊢ Sum.Lex r s (Sum.inr val✝)
      (↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
            map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
        a) →
    ∃ a',
      ↑{ toEmbedding := { toFun := Sum.inl, inj' := (_ : ∀ (x x_1 : α), Sum.inl x = Sum.inl x_1 → x = x_1) },
              map_rel_iff' := (_ : ∀ {a b : α}, Sum.Lex r s (Sum.inl a) (Sum.inl b) ↔ r a b) }
          a' =
        Sum.inr val✝
[PROOFSTEP]
exact False.elim ∘ Sum.lex_inr_inl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
a : α
⊢ Acc r a → Acc s (↑f a)
[PROOFSTEP]
refine' fun h => Acc.recOn h fun a _ ha => Acc.intro _ fun b hb => _
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
a✝ : α
h : Acc r a✝
a : α
x✝ : ∀ (y : α), r y a → Acc r y
ha : ∀ (y : α), r y a → Acc s (↑f y)
b : β
hb : s b (↑f a)
⊢ Acc s b
[PROOFSTEP]
obtain ⟨a', rfl⟩ := f.init hb
[GOAL]
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≼i s
a✝ : α
h : Acc r a✝
a : α
x✝ : ∀ (y : α), r y a → Acc r y
ha : ∀ (y : α), r y a → Acc s (↑f y)
a' : α
hb : s (↑f a') (↑f a)
⊢ Acc s (↑f a')
[PROOFSTEP]
exact ha _ (f.map_rel_iff.mp hb)
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝ : IsWellOrder α r
f : r ≺i r
⊢ False
[PROOFSTEP]
have h := f.lt_top f.top
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝ : IsWellOrder α r
f : r ≺i r
h : r (↑f.toRelEmbedding f.top) f.top
⊢ False
[PROOFSTEP]
rw [show f f.top = f.top from InitialSeg.eq (↑f) (InitialSeg.refl r) f.top] at h
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝ : IsWellOrder α r
f : r ≺i r
h : r f.top f.top
⊢ False
[PROOFSTEP]
exact _root_.irrefl _ h
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≺i s
g : s ≼i t
a : γ
⊢ t a (↑g f.top) ↔ ∃ a_1, ↑(RelEmbedding.trans f.toRelEmbedding g.toRelEmbedding) a_1 = a
[PROOFSTEP]
simp only [g.init_iff, PrincipalSeg.down, exists_and_left.symm, exists_swap, RelEmbedding.trans_apply, exists_eq_right',
  InitialSeg.coe_coe_fn]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≃r s
g : s ≺i t
c : γ
x✝ : ∃ a, ↑g.toRelEmbedding a = c
b : β
h : ↑g.toRelEmbedding b = c
⊢ ↑g.toRelEmbedding (↑f (↑(RelIso.symm f) b)) = c
[PROOFSTEP]
simp only [h, RelIso.apply_symm_apply]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≃r s
g : s ≺i t
c : γ
this : (∃ a, ↑g.toRelEmbedding a = c) ↔ ∃ a, ↑g.toRelEmbedding (↑f a) = c
⊢ t c g.top ↔ ∃ a, ↑(RelEmbedding.trans (RelIso.toRelEmbedding f) g.toRelEmbedding) a = c
[PROOFSTEP]
simpa [PrincipalSeg.down]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t✝ : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≺i s
g : s ≃r t
⊢ ∀ (b : γ), t b (↑g f.top) ↔ ∃ a, ↑(RelEmbedding.trans f.toRelEmbedding (RelIso.toRelEmbedding g)) a = b
[PROOFSTEP]
intro x
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t✝ : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≺i s
g : s ≃r t
x : γ
⊢ t x (↑g f.top) ↔ ∃ a, ↑(RelEmbedding.trans f.toRelEmbedding (RelIso.toRelEmbedding g)) a = x
[PROOFSTEP]
rw [← g.apply_symm_apply x, g.map_rel_iff, f.down', exists_congr]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t✝ : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≺i s
g : s ≃r t
x : γ
⊢ ∀ (a : α),
    ↑f.toRelEmbedding a = ↑(RelIso.symm g) x ↔
      ↑(RelEmbedding.trans f.toRelEmbedding (RelIso.toRelEmbedding g)) a = ↑g (↑(RelIso.symm g) x)
[PROOFSTEP]
intro y
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t✝ : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : r ≺i s
g : s ≃r t
x : γ
y : α
⊢ ↑f.toRelEmbedding y = ↑(RelIso.symm g) x ↔
    ↑(RelEmbedding.trans f.toRelEmbedding (RelIso.toRelEmbedding g)) y = ↑g (↑(RelIso.symm g) x)
[PROOFSTEP]
exact ⟨congr_arg g, fun h => g.toEquiv.bijective.1 h⟩
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
⊢ f = g
[PROOFSTEP]
have ef : (f : α → β) = g := by
  show ((f : r ≼i s) : α → β) = (g : r ≼i s)
  rw [@Subsingleton.elim _ _ (f : r ≼i s) g]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
⊢ ↑f.toRelEmbedding = ↑g.toRelEmbedding
[PROOFSTEP]
show ((f : r ≼i s) : α → β) = (g : r ≼i s)
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
⊢ ↑{ toRelEmbedding := f.toRelEmbedding,
        init' := (_ : ∀ (x : α) (x_1 : β), s x_1 (↑f.toRelEmbedding x) → ∃ a', ↑f.toRelEmbedding a' = x_1) } =
    ↑{ toRelEmbedding := g.toRelEmbedding,
        init' := (_ : ∀ (x : α) (x_1 : β), s x_1 (↑g.toRelEmbedding x) → ∃ a', ↑g.toRelEmbedding a' = x_1) }
[PROOFSTEP]
rw [@Subsingleton.elim _ _ (f : r ≼i s) g]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
ef : ↑f.toRelEmbedding = ↑g.toRelEmbedding
⊢ f = g
[PROOFSTEP]
have et : f.top = g.top := by
  refine' extensional_of_trichotomous_of_irrefl s fun x => _
  simp only [PrincipalSeg.down, ef]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
ef : ↑f.toRelEmbedding = ↑g.toRelEmbedding
⊢ f.top = g.top
[PROOFSTEP]
refine' extensional_of_trichotomous_of_irrefl s fun x => _
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
ef : ↑f.toRelEmbedding = ↑g.toRelEmbedding
x : β
⊢ s x f.top ↔ s x g.top
[PROOFSTEP]
simp only [PrincipalSeg.down, ef]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f g : r ≺i s
ef : ↑f.toRelEmbedding = ↑g.toRelEmbedding
et : f.top = g.top
⊢ f = g
[PROOFSTEP]
cases f
[GOAL]
case mk
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
g : r ≺i s
toRelEmbedding✝ : r ↪r s
top✝ : β
down'✝ : ∀ (b : β), s b top✝ ↔ ∃ a, ↑toRelEmbedding✝ a = b
ef : ↑{ toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.toRelEmbedding = ↑g.toRelEmbedding
et : { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.top = g.top
⊢ { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ } = g
[PROOFSTEP]
cases g
[GOAL]
case mk.mk
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
toRelEmbedding✝¹ : r ↪r s
top✝¹ : β
down'✝¹ : ∀ (b : β), s b top✝¹ ↔ ∃ a, ↑toRelEmbedding✝¹ a = b
toRelEmbedding✝ : r ↪r s
top✝ : β
down'✝ : ∀ (b : β), s b top✝ ↔ ∃ a, ↑toRelEmbedding✝ a = b
ef :
  ↑{ toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ }.toRelEmbedding =
    ↑{ toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.toRelEmbedding
et :
  { toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ }.top =
    { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.top
⊢ { toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ } =
    { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }
[PROOFSTEP]
have := RelEmbedding.coe_fn_injective ef
[GOAL]
case mk.mk
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
toRelEmbedding✝¹ : r ↪r s
top✝¹ : β
down'✝¹ : ∀ (b : β), s b top✝¹ ↔ ∃ a, ↑toRelEmbedding✝¹ a = b
toRelEmbedding✝ : r ↪r s
top✝ : β
down'✝ : ∀ (b : β), s b top✝ ↔ ∃ a, ↑toRelEmbedding✝ a = b
ef :
  ↑{ toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ }.toRelEmbedding =
    ↑{ toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.toRelEmbedding
et :
  { toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ }.top =
    { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.top
this :
  { toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ }.toRelEmbedding =
    { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }.toRelEmbedding
⊢ { toRelEmbedding := toRelEmbedding✝¹, top := top✝¹, down' := down'✝¹ } =
    { toRelEmbedding := toRelEmbedding✝, top := top✝, down' := down'✝ }
[PROOFSTEP]
congr
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder γ t
e : r ≃r s
f : r ≺i t
g : s ≺i t
⊢ f.top = g.top
[PROOFSTEP]
rw [Subsingleton.elim f (PrincipalSeg.equivLT e g)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder γ t
e : r ≃r s
f : r ≺i t
g : s ≺i t
⊢ (equivLT e g).top = g.top
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t✝ : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder γ t
f : r ≺i s
g : s ≺i t
h : r ≺i t
⊢ t h.top g.top
[PROOFSTEP]
rw [Subsingleton.elim h (f.trans g)]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s✝ : β → β → Prop
t✝ : γ → γ → Prop
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder γ t
f : r ≺i s
g : s ≺i t
h : r ≺i t
⊢ t (PrincipalSeg.trans f g).top g.top
[PROOFSTEP]
apply PrincipalSeg.lt_top
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
r : α → α → Prop
inst✝ : IsEmpty α
b : β
H : ∀ (b' : β), ¬s b' b
src✝ : r ↪r s := RelEmbedding.ofIsEmpty r s
⊢ ∀ (b_1 : β),
    s b_1 b ↔
      ∃ a,
        ↑{ toEmbedding := src✝.toEmbedding,
                map_rel_iff' := (_ : ∀ {a b : α}, s (↑src✝.toEmbedding a) (↑src✝.toEmbedding b) ↔ r a b) }
            a =
          b_1
[PROOFSTEP]
simp [H]
[GOAL]
α : Type u_1
β✝ : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
β : Type u_4
s : β → β → Prop
inst✝ : IsTrans β s
⊢ WellFounded s ↔ ∀ (b : β), WellFounded (Subrel s {b' | s b' b})
[PROOFSTEP]
refine'
  ⟨fun wf b => ⟨fun b' => ((PrincipalSeg.ofElement _ b).acc b').mpr (wf.apply b')⟩, fun wf =>
    ⟨fun b => Acc.intro _ fun b' hb' => _⟩⟩
[GOAL]
α : Type u_1
β✝ : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
β : Type u_4
s : β → β → Prop
inst✝ : IsTrans β s
wf : ∀ (b : β), WellFounded (Subrel s {b' | s b' b})
b b' : β
hb' : s b' b
⊢ Acc s b'
[PROOFSTEP]
let f := PrincipalSeg.ofElement s b
[GOAL]
α : Type u_1
β✝ : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
β : Type u_4
s : β → β → Prop
inst✝ : IsTrans β s
wf : ∀ (b : β), WellFounded (Subrel s {b' | s b' b})
b b' : β
hb' : s b' b
f : Subrel s {b_1 | s b_1 b} ≺i s := PrincipalSeg.ofElement s b
⊢ Acc s b'
[PROOFSTEP]
obtain ⟨b', rfl⟩ := f.down.mp ((PrincipalSeg.ofElement_top s b).symm ▸ hb' : s b' f.top)
[GOAL]
case intro
α : Type u_1
β✝ : Type u_2
γ : Type u_3
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
β : Type u_4
s : β → β → Prop
inst✝ : IsTrans β s
wf : ∀ (b : β), WellFounded (Subrel s {b' | s b' b})
b : β
f : Subrel s {b_1 | s b_1 b} ≺i s := PrincipalSeg.ofElement s b
b' : ↑{b_1 | s b_1 b}
hb' : s (↑f.toRelEmbedding b') b
⊢ Acc s (↑f.toRelEmbedding b')
[PROOFSTEP]
exact (f.acc b').mp ((wf b).apply b')
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ≼i s
⊢ (r ≺i s) ⊕ (r ≃r s)
[PROOFSTEP]
by_cases h : Surjective f
[GOAL]
case pos
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ≼i s
h : Surjective ↑f
⊢ (r ≺i s) ⊕ (r ≃r s)
[PROOFSTEP]
exact Sum.inr (RelIso.ofSurjective f h)
[GOAL]
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ≼i s
h : ¬Surjective ↑f
⊢ (r ≺i s) ⊕ (r ≃r s)
[PROOFSTEP]
have h' : _ := (InitialSeg.eq_or_principal f).resolve_left h
[GOAL]
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ≼i s
h : ¬Surjective ↑f
h' : ∃ b, ∀ (x : β), s x b ↔ ∃ y, ↑f y = x
⊢ (r ≺i s) ⊕ (r ≃r s)
[PROOFSTEP]
exact Sum.inl ⟨f, Classical.choose h', Classical.choose_spec h'⟩
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : IsWellOrder β s
inst✝ : IsTrans γ t
f : r ≼i s
g : s ≺i t
a : α
⊢ ↑(leLT f g).toRelEmbedding a = ↑g.toRelEmbedding (↑f a)
[PROOFSTEP]
delta InitialSeg.leLT
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : IsWellOrder β s
inst✝ : IsTrans γ t
f : r ≼i s
g : s ≺i t
a : α
⊢ ↑(match ltOrEq f with
          | Sum.inl f' => PrincipalSeg.trans f' g
          | Sum.inr f' => PrincipalSeg.equivLT f' g).toRelEmbedding
      a =
    ↑g.toRelEmbedding (↑f a)
[PROOFSTEP]
cases' h : f.ltOrEq with f' f'
[GOAL]
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : IsWellOrder β s
inst✝ : IsTrans γ t
f : r ≼i s
g : s ≺i t
a : α
f' : r ≺i s
h : ltOrEq f = Sum.inl f'
⊢ ↑(match Sum.inl f' with
          | Sum.inl f' => PrincipalSeg.trans f' g
          | Sum.inr f' => PrincipalSeg.equivLT f' g).toRelEmbedding
      a =
    ↑g.toRelEmbedding (↑f a)
[PROOFSTEP]
simp only [PrincipalSeg.trans_apply, f.ltOrEq_apply_left]
[GOAL]
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝¹ : IsWellOrder β s
inst✝ : IsTrans γ t
f : r ≼i s
g : s ≺i t
a : α
f' : r ≃r s
h : ltOrEq f = Sum.inr f'
⊢ ↑(match Sum.inr f' with
          | Sum.inl f' => PrincipalSeg.trans f' g
          | Sum.inr f' => PrincipalSeg.equivLT f' g).toRelEmbedding
      a =
    ↑g.toRelEmbedding (↑f a)
[PROOFSTEP]
simp only [PrincipalSeg.equivLT_apply, f.ltOrEq_apply_right]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
IH : (y : α) → r y a → { b // ¬s (↑f y) b }
⊢ { b // ¬s (↑f a) b }
[PROOFSTEP]
let S := {b | ∀ a h, s (IH a h).1 b}
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
IH : (y : α) → r y a → { b // ¬s (↑f y) b }
S : Set β := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b}
⊢ { b // ¬s (↑f a) b }
[PROOFSTEP]
have : f a ∈ S := fun a' h =>
  ((trichotomous _ _).resolve_left fun h' => (IH a' h).2 <| _root_.trans (f.map_rel_iff.2 h) h').resolve_left fun h' =>
    (IH a' h).2 <| h' ▸ f.map_rel_iff.2 h
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
IH : (y : α) → r y a → { b // ¬s (↑f y) b }
S : Set β := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b}
this : ↑f a ∈ S
⊢ { b // ¬s (↑f a) b }
[PROOFSTEP]
exact ⟨_, IsWellFounded.wf.not_lt_min _ ⟨_, this⟩ this⟩
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a✝ a : α
⊢ r a a✝ → s ↑(collapseF f a) ↑(collapseF f a✝)
[PROOFSTEP]
revert a
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
⊢ ∀ (a_1 : α), r a_1 a → s ↑(collapseF f a_1) ↑(collapseF f a)
[PROOFSTEP]
show (collapseF f a).1 ∈ {b | ∀ (a') (_ : r a' a), s (collapseF f a').1 b}
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
⊢ ↑(collapseF f a) ∈ {b | ∀ (a' : α), r a' a → s (↑(collapseF f a')) b}
[PROOFSTEP]
unfold collapseF
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
⊢ ↑(WellFounded.fix (_ : WellFounded r)
        (fun a IH =>
          let S := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b};
          let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
          { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
            property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
        a) ∈
    {b |
      ∀ (a' : α),
        r a' a →
          s
            (↑(WellFounded.fix (_ : WellFounded r)
                (fun a IH =>
                  let S := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b};
                  let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
                  { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
                    property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
                a'))
            b}
[PROOFSTEP]
rw [WellFounded.fix_eq]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
⊢ ↑(let S :=
        {b |
          ∀ (a_1 : α) (h : r a_1 a),
            s
              (↑((fun y x =>
                    WellFounded.fix (_ : WellFounded r)
                      (fun a IH =>
                        let S := {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b};
                        let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
                        { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
                          property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
                      y)
                  a_1 h))
              b};
      let_fun this :=
        (_ :
          ∀ (a' : α),
            r a' a →
              s
                (↑(WellFounded.fix (_ : WellFounded r)
                    (fun a IH =>
                      let S := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b};
                      let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
                      { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
                        property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
                    a'))
                (↑f a));
      { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
        property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) }) ∈
    {b |
      ∀ (a' : α),
        r a' a →
          s
            (↑(WellFounded.fix (_ : WellFounded r)
                (fun a IH =>
                  let S := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b};
                  let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
                  { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
                    property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
                a'))
            b}
[PROOFSTEP]
dsimp only
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
⊢ WellFounded.min (_ : WellFounded s)
      {b |
        ∀ (a_1 : α),
          r a_1 a →
            s
              (↑(WellFounded.fix (_ : WellFounded r)
                  (fun a IH =>
                    {
                      val :=
                        WellFounded.min (_ : WellFounded s) {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                          (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}),
                      property :=
                        (_ :
                          ¬s (↑f a)
                              (WellFounded.min (_ : WellFounded s) {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                                (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}))) })
                  a_1))
              b}
      (_ :
        ∃ x,
          x ∈
            {b |
              ∀ (a_1 : α),
                r a_1 a →
                  s
                    (↑(WellFounded.fix (_ : WellFounded r)
                        (fun a IH =>
                          {
                            val :=
                              WellFounded.min (_ : WellFounded s) {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                                (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}),
                            property :=
                              (_ :
                                ¬s (↑f a)
                                    (WellFounded.min (_ : WellFounded s)
                                      {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                                      (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}))) })
                        a_1))
                    b}) ∈
    {b |
      ∀ (a' : α),
        r a' a →
          s
            (↑(WellFounded.fix (_ : WellFounded r)
                (fun a IH =>
                  {
                    val :=
                      WellFounded.min (_ : WellFounded s) {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b}
                        (_ : ∃ x, x ∈ {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b}),
                    property :=
                      (_ :
                        ¬s (↑f a)
                            (WellFounded.min (_ : WellFounded s) {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b}
                              (_ : ∃ x, x ∈ {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b}))) })
                a'))
            b}
[PROOFSTEP]
apply WellFounded.min_mem _ _
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
b : β
h : ∀ (a' : α), r a' a → s (↑(collapseF f a')) b
⊢ ¬s b ↑(collapseF f a)
[PROOFSTEP]
unfold collapseF
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
b : β
h : ∀ (a' : α), r a' a → s (↑(collapseF f a')) b
⊢ ¬s b
      ↑(WellFounded.fix (_ : WellFounded r)
          (fun a IH =>
            let S := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b};
            let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
            { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
              property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
          a)
[PROOFSTEP]
rw [WellFounded.fix_eq]
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
b : β
h : ∀ (a' : α), r a' a → s (↑(collapseF f a')) b
⊢ ¬s b
      ↑(let S :=
          {b |
            ∀ (a_1 : α) (h : r a_1 a),
              s
                (↑((fun y x =>
                      WellFounded.fix (_ : WellFounded r)
                        (fun a IH =>
                          let S := {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b};
                          let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
                          { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
                            property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
                        y)
                    a_1 h))
                b};
        let_fun this :=
          (_ :
            ∀ (a' : α),
              r a' a →
                s
                  (↑(WellFounded.fix (_ : WellFounded r)
                      (fun a IH =>
                        let S := {b | ∀ (a_1 : α) (h : r a_1 a), s (↑(IH a_1 h)) b};
                        let_fun this := (_ : ∀ (a' : α) (h : r a' a), s (↑(IH a' h)) (↑f a));
                        { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
                          property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
                      a'))
                  (↑f a));
        { val := WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S),
          property := (_ : ¬s (↑f a) (WellFounded.min (_ : WellFounded s) S (_ : ∃ x, x ∈ S))) })
[PROOFSTEP]
dsimp only
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
a : α
b : β
h : ∀ (a' : α), r a' a → s (↑(collapseF f a')) b
⊢ ¬s b
      (WellFounded.min (_ : WellFounded s)
        {b |
          ∀ (a_1 : α),
            r a_1 a →
              s
                (↑(WellFounded.fix (_ : WellFounded r)
                    (fun a IH =>
                      {
                        val :=
                          WellFounded.min (_ : WellFounded s) {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                            (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}),
                        property :=
                          (_ :
                            ¬s (↑f a)
                                (WellFounded.min (_ : WellFounded s) {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                                  (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}))) })
                    a_1))
                b}
        (_ :
          ∃ x,
            x ∈
              {b |
                ∀ (a_1 : α),
                  r a_1 a →
                    s
                      (↑(WellFounded.fix (_ : WellFounded r)
                          (fun a IH =>
                            {
                              val :=
                                WellFounded.min (_ : WellFounded s) {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                                  (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}),
                              property :=
                                (_ :
                                  ¬s (↑f a)
                                      (WellFounded.min (_ : WellFounded s)
                                        {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}
                                        (_ : ∃ x, x ∈ {b | ∀ (a_2 : α) (h : r a_2 a), s (↑(IH a_2 h)) b}))) })
                          a_1))
                      b}))
[PROOFSTEP]
exact WellFounded.not_lt_min _ _ _ h
[GOAL]
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
this : IsWellOrder α r
a✝ : α
b✝ b : β
x✝¹ : ∀ (y : β), s y b → Acc s y
x✝ :
  ∀ (y : β),
    s y b →
      ∀ (x : α),
        s y
            (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
              x) →
          ∃ a',
            ↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
                a' =
              y
a : α
h : s b (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b))) a)
⊢ ∃ a', ↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b))) a' = b
[PROOFSTEP]
rcases(@IsWellFounded.wf _ r).has_min {a | ¬s (collapseF f a).1 b} ⟨_, asymm h⟩ with ⟨m, hm, hm'⟩
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
this : IsWellOrder α r
a✝ : α
b✝ b : β
x✝¹ : ∀ (y : β), s y b → Acc s y
x✝ :
  ∀ (y : β),
    s y b →
      ∀ (x : α),
        s y
            (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
              x) →
          ∃ a',
            ↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
                a' =
              y
a : α
h : s b (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b))) a)
m : α
hm : m ∈ {a | ¬s (↑(collapseF f a)) b}
hm' : ∀ (x : α), x ∈ {a | ¬s (↑(collapseF f a)) b} → ¬r x m
⊢ ∃ a', ↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b))) a' = b
[PROOFSTEP]
refine' ⟨m, ((@trichotomous _ s _ _ _).resolve_left hm).resolve_right (collapseF.not_lt f _ fun a' h' => _)⟩
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
this : IsWellOrder α r
a✝ : α
b✝ b : β
x✝¹ : ∀ (y : β), s y b → Acc s y
x✝ :
  ∀ (y : β),
    s y b →
      ∀ (x : α),
        s y
            (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
              x) →
          ∃ a',
            ↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
                a' =
              y
a : α
h : s b (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b))) a)
m : α
hm : m ∈ {a | ¬s (↑(collapseF f a)) b}
hm' : ∀ (x : α), x ∈ {a | ¬s (↑(collapseF f a)) b} → ¬r x m
a' : α
h' : r a' m
⊢ s (↑(collapseF f a')) b
[PROOFSTEP]
by_contra hn
[GOAL]
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
inst✝ : IsWellOrder β s
f : r ↪r s
this : IsWellOrder α r
a✝ : α
b✝ b : β
x✝¹ : ∀ (y : β), s y b → Acc s y
x✝ :
  ∀ (y : β),
    s y b →
      ∀ (x : α),
        s y
            (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
              x) →
          ∃ a',
            ↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b)))
                a' =
              y
a : α
h : s b (↑(ofMonotone (fun a => ↑(collapseF f a)) (_ : ∀ (a b : α), r a b → s ↑(collapseF f a) ↑(collapseF f b))) a)
m : α
hm : m ∈ {a | ¬s (↑(collapseF f a)) b}
hm' : ∀ (x : α), x ∈ {a | ¬s (↑(collapseF f a)) b} → ¬r x m
a' : α
h' : r a' m
hn : ¬s (↑(collapseF f a')) b
⊢ False
[PROOFSTEP]
exact hm' _ hn h'