[GOAL]
α✝ : Sort u
β✝ : Sort v
f : α✝ ≃ β✝
α : Sort u_1
β : Type u_2
p : β → Prop
e : α ≃ Subtype p
x : β
hs : x ∈ setOf p
⊢ ↑(asEmbedding e) (↑e.symm { val := x, property := hs }) = x
[PROOFSTEP]
simp
[GOAL]
α : Type ?u.1349
β : Type ?u.1350
f : Option α ↪ β
⊢ ∀ (x : Option α),
    ↑((fun f => optionElim f.fst ↑f.snd (_ : ↑f.snd ∈ (Set.range ↑f.fst)ᶜ))
            ((fun f =>
                { fst := Embedding.trans coeWithTop f,
                  snd :=
                    { val := ↑f none, property := (_ : ↑f none ∈ Set.range ↑(Embedding.trans coeWithTop f) → False) } })
              f))
        x =
      ↑f x
[PROOFSTEP]
rintro (_ | _)
[GOAL]
case none
α : Type ?u.1349
β : Type ?u.1350
f : Option α ↪ β
⊢ ↑((fun f => optionElim f.fst ↑f.snd (_ : ↑f.snd ∈ (Set.range ↑f.fst)ᶜ))
          ((fun f =>
              { fst := Embedding.trans coeWithTop f,
                snd :=
                  { val := ↑f none, property := (_ : ↑f none ∈ Set.range ↑(Embedding.trans coeWithTop f) → False) } })
            f))
      none =
    ↑f none
[PROOFSTEP]
simp [Option.coe_def]
[GOAL]
case some
α : Type ?u.1349
β : Type ?u.1350
f : Option α ↪ β
val✝ : α
⊢ ↑((fun f => optionElim f.fst ↑f.snd (_ : ↑f.snd ∈ (Set.range ↑f.fst)ᶜ))
          ((fun f =>
              { fst := Embedding.trans coeWithTop f,
                snd :=
                  { val := ↑f none, property := (_ : ↑f none ∈ Set.range ↑(Embedding.trans coeWithTop f) → False) } })
            f))
      (some val✝) =
    ↑f (some val✝)
[PROOFSTEP]
simp [Option.coe_def]
[GOAL]
case some
α : Type ?u.1349
β : Type ?u.1350
f : Option α ↪ β
val✝ : α
⊢ ↑val✝ = some val✝
[PROOFSTEP]
rfl
[GOAL]
α : Type ?u.1349
β : Type ?u.1350
x✝ : (f : α ↪ β) × ↑(Set.range ↑f)ᶜ
f : α ↪ β
y : β
hy : y ∈ (Set.range ↑f)ᶜ
⊢ (fun f =>
        { fst := Embedding.trans coeWithTop f,
          snd := { val := ↑f none, property := (_ : ↑f none ∈ Set.range ↑(Embedding.trans coeWithTop f) → False) } })
      ((fun f => optionElim f.fst ↑f.snd (_ : ↑f.snd ∈ (Set.range ↑f.fst)ᶜ))
        { fst := f, snd := { val := y, property := hy } }) =
    { fst := f, snd := { val := y, property := hy } }
[PROOFSTEP]
ext
[GOAL]
case a.h
α : Type ?u.1349
β : Type ?u.1350
x✝¹ : (f : α ↪ β) × ↑(Set.range ↑f)ᶜ
f : α ↪ β
y : β
hy : y ∈ (Set.range ↑f)ᶜ
x✝ : α
⊢ ↑((fun f =>
              { fst := Embedding.trans coeWithTop f,
                snd :=
                  { val := ↑f none, property := (_ : ↑f none ∈ Set.range ↑(Embedding.trans coeWithTop f) → False) } })
            ((fun f => optionElim f.fst ↑f.snd (_ : ↑f.snd ∈ (Set.range ↑f.fst)ᶜ))
              { fst := f, snd := { val := y, property := hy } })).fst
      x✝ =
    ↑{ fst := f, snd := { val := y, property := hy } }.fst x✝
[PROOFSTEP]
simp [Option.coe_def]
[GOAL]
case a
α : Type ?u.1349
β : Type ?u.1350
x✝ : (f : α ↪ β) × ↑(Set.range ↑f)ᶜ
f : α ↪ β
y : β
hy : y ∈ (Set.range ↑f)ᶜ
⊢ ↑((fun f =>
            { fst := Embedding.trans coeWithTop f,
              snd :=
                { val := ↑f none, property := (_ : ↑f none ∈ Set.range ↑(Embedding.trans coeWithTop f) → False) } })
          ((fun f => optionElim f.fst ↑f.snd (_ : ↑f.snd ∈ (Set.range ↑f.fst)ᶜ))
            { fst := f, snd := { val := y, property := hy } })).snd =
    ↑{ fst := f, snd := { val := y, property := hy } }.snd
[PROOFSTEP]
simp [Option.coe_def]
[GOAL]
case a.h
α : Type ?u.1349
β : Type ?u.1350
x✝¹ : (f : α ↪ β) × ↑(Set.range ↑f)ᶜ
f : α ↪ β
y : β
hy : y ∈ (Set.range ↑f)ᶜ
x✝ : α
⊢ ↑(optionElim f y
          (_ :
            ↑{ fst := f, snd := { val := y, property := hy } }.snd ∈
              (Set.range ↑{ fst := f, snd := { val := y, property := hy } }.fst)ᶜ))
      ↑x✝ =
    ↑f x✝
[PROOFSTEP]
rfl
[GOAL]
α : Type ?u.4882
s t : Set α
h✝ : s ⊆ t
x✝¹ x✝ : ↑s
x : α
hx : x ∈ s
y : α
hy : y ∈ s
h :
  (fun x => { val := ↑x, property := (_ : ↑x ∈ t) }) { val := x, property := hx } =
    (fun x => { val := ↑x, property := (_ : ↑x ∈ t) }) { val := y, property := hy }
⊢ { val := x, property := hx } = { val := y, property := hy }
[PROOFSTEP]
congr
[GOAL]
case e_val
α : Type ?u.4882
s t : Set α
h✝ : s ⊆ t
x✝¹ x✝ : ↑s
x : α
hx : x ∈ s
y : α
hy : y ∈ s
h :
  (fun x => { val := ↑x, property := (_ : ↑x ∈ t) }) { val := x, property := hx } =
    (fun x => { val := ↑x, property := (_ : ↑x ∈ t) }) { val := y, property := hy }
⊢ x = y
[PROOFSTEP]
injection h
[GOAL]
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x ∨ q x }
⊢ Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
      (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)))
      (↑(subtypeOrLeftEmbedding p q) x) =
    x
[PROOFSTEP]
by_cases hx : p x
[GOAL]
case pos
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x ∨ q x }
hx : p ↑x
⊢ Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
      (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)))
      (↑(subtypeOrLeftEmbedding p q) x) =
    x
[PROOFSTEP]
rw [subtypeOrLeftEmbedding_apply_left _ hx]
[GOAL]
case pos
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x ∨ q x }
hx : p ↑x
⊢ Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
      (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)))
      (Sum.inl { val := ↑x, property := hx }) =
    x
[PROOFSTEP]
simp [Subtype.ext_iff]
[GOAL]
case neg
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x ∨ q x }
hx : ¬p ↑x
⊢ Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
      (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)))
      (↑(subtypeOrLeftEmbedding p q) x) =
    x
[PROOFSTEP]
rw [subtypeOrLeftEmbedding_apply_right _ hx]
[GOAL]
case neg
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x ∨ q x }
hx : ¬p ↑x
⊢ Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
      (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)))
      (Sum.inr { val := ↑x, property := (_ : q ↑x) }) =
    x
[PROOFSTEP]
simp [Subtype.ext_iff]
[GOAL]
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x } ⊕ { x // q x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
        (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x))) x) =
    x
[PROOFSTEP]
cases x with
| inl x =>
  simp only [Sum.elim_inl]
  rw [subtypeOrLeftEmbedding_apply_left]
  · simp
  · simpa using x.prop
| inr x =>
  simp only [Sum.elim_inr]
  rw [subtypeOrLeftEmbedding_apply_right]
  · simp
  · suffices ¬p x by simpa
    intro hp
    simpa using h.le_bot x ⟨hp, x.prop⟩
[GOAL]
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x } ⊕ { x // q x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
        (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x))) x) =
    x
[PROOFSTEP]
cases x with
| inl x =>
  simp only [Sum.elim_inl]
  rw [subtypeOrLeftEmbedding_apply_left]
  · simp
  · simpa using x.prop
| inr x =>
  simp only [Sum.elim_inr]
  rw [subtypeOrLeftEmbedding_apply_right]
  · simp
  · suffices ¬p x by simpa
    intro hp
    simpa using h.le_bot x ⟨hp, x.prop⟩
[GOAL]
case inl
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
        (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x))) (Sum.inl x)) =
    Sum.inl x
[PROOFSTEP]

| inl x =>
  simp only [Sum.elim_inl]
  rw [subtypeOrLeftEmbedding_apply_left]
  · simp
  · simpa using x.prop
[GOAL]
case inl
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
        (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x))) (Sum.inl x)) =
    Sum.inl x
[PROOFSTEP]
simp only [Sum.elim_inl]
[GOAL]
case inl
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)) x) =
    Sum.inl x
[PROOFSTEP]
rw [subtypeOrLeftEmbedding_apply_left]
[GOAL]
case inl
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x }
⊢ Sum.inl
      { val := ↑(↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)) x),
        property := ?inl.hx } =
    Sum.inl x
[PROOFSTEP]
simp
[GOAL]
case inl.hx
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // p x }
⊢ p ↑(↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)) x)
[PROOFSTEP]
simpa using x.prop
[GOAL]
case inr
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
        (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x))) (Sum.inr x)) =
    Sum.inr x
[PROOFSTEP]

| inr x =>
  simp only [Sum.elim_inr]
  rw [subtypeOrLeftEmbedding_apply_right]
  · simp
  · suffices ¬p x by simpa
    intro hp
    simpa using h.le_bot x ⟨hp, x.prop⟩
[GOAL]
case inr
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (Sum.elim (↑(Subtype.impEmbedding (fun x => p x) (fun x => p x ∨ q x) (_ : ∀ (x : α), p x → p x ∨ q x)))
        (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x))) (Sum.inr x)) =
    Sum.inr x
[PROOFSTEP]
simp only [Sum.elim_inr]
[GOAL]
case inr
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
⊢ ↑(subtypeOrLeftEmbedding p q)
      (↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)) x) =
    Sum.inr x
[PROOFSTEP]
rw [subtypeOrLeftEmbedding_apply_right]
[GOAL]
case inr
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
⊢ Sum.inr
      { val := ↑(↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)) x),
        property :=
          (_ : q ↑(↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)) x)) } =
    Sum.inr x
[PROOFSTEP]
simp
[GOAL]
case inr.hx
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
⊢ ¬p ↑(↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)) x)
[PROOFSTEP]
suffices ¬p x by simpa
[GOAL]
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
this : ¬p ↑x
⊢ ¬p ↑(↑(Subtype.impEmbedding (fun x => q x) (fun x => p x ∨ q x) (_ : ∀ (x : α), q x → p x ∨ q x)) x)
[PROOFSTEP]
simpa
[GOAL]
case inr.hx
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
⊢ ¬p ↑x
[PROOFSTEP]
intro hp
[GOAL]
case inr.hx
α : Type u_1
p q : α → Prop
inst✝ : DecidablePred p
h : Disjoint p q
x : { x // q x }
hp : p ↑x
⊢ False
[PROOFSTEP]
simpa using h.le_bot x ⟨hp, x.prop⟩