l3lab/ntp-mathlib huggingface dataset:
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      

Proof state:
case intro.intro.intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
seq : ℕ → F
hmem : ∀ (n : ℕ), seq n ∈ ↑(ConvexCone.map ↑f ↑K)
htends : Tendsto seq atTop (nhds b)
y : F
hinner : ∀ ⦃x : E⦄, x ∈ K → 0 ≤ inner (f x) y
n : ℕ
w✝ : E
h : w✝ ∈ ↑↑K
hseq : ↑f w✝ = seq n
⊢ 0 ≤ inner y (seq n)

Next tactic:
simpa only [← hseq, real_inner_comm] using hinner h
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
⊢ (∀ (y : F), (adjoint f) y ∈ dual K → 0 ≤ inner y b) → b ∈ map f K

Next tactic:
intro h
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : ∀ (y : F), (adjoint f) y ∈ dual K → 0 ≤ inner y b
⊢ b ∈ map f K

Next tactic:
contrapose! h
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
⊢ ∃ y, (adjoint f) y ∈ dual K ∧ inner y b < 0

Next tactic:
obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      

Proof state:
case intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
⊢ ∃ y, (adjoint f) y ∈ dual K ∧ inner y b < 0

Next tactic:
refine' ⟨y, _, hyb⟩
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      

Proof state:
case intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
⊢ (adjoint f) y ∈ dual K

Next tactic:
simp_rw [ProperCone.mem_dual, adjoint_inner_right]
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      

Proof state:
case intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
⊢ ∀ ⦃x : E⦄, x ∈ K → 0 ≤ inner (f x) y

Next tactic:
intro x hxK
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      intro x hxK
      

Proof state:
case intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
x : E
hxK : x ∈ K
⊢ 0 ≤ inner (f x) y

Next tactic:
apply hxy (f x)
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      intro x hxK
      apply hxy (f x)
      

Proof state:
case intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
x : E
hxK : x ∈ K
⊢ f x ∈ ↑(map f K)

Next tactic:
rw [ProperCone.coe_map]
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      intro x hxK
      apply hxy (f x)
      rw [ProperCone.coe_map]
      

Proof state:
case intro.intro
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
x : E
hxK : x ∈ K
⊢ f x ∈ ConvexCone.closure (ConvexCone.map ↑f ↑K)

Next tactic:
apply subset_closure
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      intro x hxK
      apply hxy (f x)
      rw [ProperCone.coe_map]
      apply subset_closure
      

Proof state:
case intro.intro.a
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
x : E
hxK : x ∈ K
⊢ f x ∈ ↑(ConvexCone.map ↑f ↑K)

Next tactic:
rw [SetLike.mem_coe, ConvexCone.mem_map]
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      intro x hxK
      apply hxy (f x)
      rw [ProperCone.coe_map]
      apply subset_closure
      rw [SetLike.mem_coe, ConvexCone.mem_map]
      

Proof state:
case intro.intro.a
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
x : E
hxK : x ∈ K
⊢ ∃ x_1 ∈ ↑K, ↑f x_1 = f x

Next tactic:
refine' ⟨x, hxK, by rw [coe_coe]⟩
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ :=
  Iff.intro
    (by
      -- suppose `b ∈ K.map f`
      simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
        ConvexCone.mem_closure, mem_closure_iff_seq_limit]
      -- there is a sequence `seq : ℕ → F` in the image of `f` that converges to `b`
      rintro ⟨seq, hmem, htends⟩ y hinner
      suffices h : ∀ n, 0 ≤ ⟪y, seq n⟫_ℝ from
        ge_of_tendsto'
          (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
            htends)
          h
      intro n
      obtain ⟨_, h, hseq⟩ := hmem n
      simpa only [← hseq, real_inner_comm] using hinner h)
    (by
      -- proof by contradiction
      -- suppose `b ∉ K.map f`
      intro h
      contrapose! h
      -- as `b ∉ K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
      obtain ⟨y, hxy, hyb⟩ :=
        ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
          (K.map f).isClosed h
      -- the rest of the proof is a straightforward algebraic manipulation
      refine' ⟨y, _, hyb⟩
      simp_rw [ProperCone.mem_dual, adjoint_inner_right]
      intro x hxK
      apply hxy (f x)
      rw [ProperCone.coe_map]
      apply subset_closure
      rw [SetLike.mem_coe, ConvexCone.mem_map]
      refine' ⟨x, hxK, by 

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : InnerProductSpace ℝ E
inst✝³ : CompleteSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : InnerProductSpace ℝ F
inst✝ : CompleteSpace F
K : ProperCone ℝ E
f : E →L[ℝ] F
b : F
h : b ∉ map f K
y : F
hxy : ∀ x ∈ ↑(map f K), 0 ≤ inner x y
hyb : inner y b < 0
x : E
hxK : x ∈ K
⊢ ↑f x = f x

Next tactic:
rw [coe_coe]