Theorem: Caratheodory.affineIndependent_minCardFinsetOfMemConvexHull
File: Mathlib/Analysis/Convex/Caratheodory.lean

tactic: let k := (minCardFinsetOfMemConvexHull hx).card - 1
state_before: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
⊢ AffineIndependent 𝕜 Subtype.val
state_after: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
⊢ AffineIndependent 𝕜 Subtype.val

tactic: have hk : (minCardFinsetOfMemConvexHull hx).card = k + 1 :=
  (Nat.succ_pred_eq_of_pos (Finset.card_pos.mpr (minCardFinsetOfMemConvexHull_nonempty hx))).symm
state_before: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
⊢ AffineIndependent 𝕜 Subtype.val
state_after: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
⊢ AffineIndependent 𝕜 Subtype.val

tactic: classical
by_contra h
obtain ⟨p, hp⟩ := mem_convexHull_erase h (mem_minCardFinsetOfMemConvexHull hx)
have contra := minCardFinsetOfMemConvexHull_card_le_card hx (Set.Subset.trans
  (Finset.erase_subset (p : E) (minCardFinsetOfMemConvexHull hx))
  (minCardFinsetOfMemConvexHull_subseteq hx)) hp
rw [← not_lt] at contra
apply contra
erw [card_erase_of_mem p.2, hk]
exact lt_add_one _
state_before: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
⊢ AffineIndependent 𝕜 Subtype.val
state_after: no goals

tactic: by_contra h
state_before: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
⊢ AffineIndependent 𝕜 Subtype.val
state_after: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
⊢ False

tactic: obtain ⟨p, hp⟩ := mem_convexHull_erase h (mem_minCardFinsetOfMemConvexHull hx)
state_before: 𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
⊢ False
state_after: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
⊢ False

tactic: have contra := minCardFinsetOfMemConvexHull_card_le_card hx (Set.Subset.trans
  (Finset.erase_subset (p : E) (minCardFinsetOfMemConvexHull hx))
  (minCardFinsetOfMemConvexHull_subseteq hx)) hp
state_before: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
⊢ False
state_after: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : (minCardFinsetOfMemConvexHull hx).card ≤ ((minCardFinsetOfMemConvexHull hx).erase ↑p).card
⊢ False

tactic: rw [← not_lt] at contra
state_before: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : (minCardFinsetOfMemConvexHull hx).card ≤ ((minCardFinsetOfMemConvexHull hx).erase ↑p).card
⊢ False
state_after: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : ¬((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
⊢ False

tactic: apply contra
state_before: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : ¬((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
⊢ False
state_after: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : ¬((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
⊢ ((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card

tactic: erw [card_erase_of_mem p.2, hk]
state_before: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : ¬((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
⊢ ((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
state_after: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : ¬((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
⊢ k + 1 - 1 < k + 1

tactic: exact lt_add_one _
state_before: case intro
𝕜 : Type u_1
E : Type u
inst✝² : LinearOrderedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
s : Set E
x : E
hx : x ∈ (convexHull 𝕜) s
k : ℕ := (minCardFinsetOfMemConvexHull hx).card - 1
hk : (minCardFinsetOfMemConvexHull hx).card = k + 1
h : ¬AffineIndependent 𝕜 Subtype.val
p : ↑↑(minCardFinsetOfMemConvexHull hx)
hp : x ∈ (convexHull 𝕜) ↑((minCardFinsetOfMemConvexHull hx).erase ↑p)
contra : ¬((minCardFinsetOfMemConvexHull hx).erase ↑p).card < (minCardFinsetOfMemConvexHull hx).card
⊢ k + 1 - 1 < k + 1
state_after: no goals