Theorem: Affine.Simplex.mongePointVSubFaceCentroidWeightsWithCircumcenter_eq_sub
File: Mathlib/Geometry/Euclidean/MongePoint.lean

tactic: ext i
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ =
    mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ
state_after: case h
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : PointsWithCircumcenterIndex (n + 2)
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ i =
    (mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ) i

tactic: cases' i with i
state_before: case h
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : PointsWithCircumcenterIndex (n + 2)
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ i =
    (mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ) i
state_after: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ (pointIndex i) =
    (mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ) (pointIndex i)

case h.circumcenterIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ circumcenterIndex =
    (mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ) circumcenterIndex

tactic: rw [Pi.sub_apply, mongePointWeightsWithCircumcenter, centroidWeightsWithCircumcenter,
  mongePointVSubFaceCentroidWeightsWithCircumcenter]
state_before: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ (pointIndex i) =
    (mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ) (pointIndex i)
state_after: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
⊢ (match pointIndex i with
    | pointIndex i => if i = i₁ ∨ i = i₂ then (↑(n + 1))⁻¹ else 0
    | circumcenterIndex => -2 / ↑(n + 1)) =
    (match pointIndex i with
      | pointIndex a => (↑(n + 1))⁻¹
      | circumcenterIndex => -2 / ↑(n + 1)) -
      match pointIndex i with
      | pointIndex i => if i ∈ {i₁, i₂}ᶜ then (↑{i₁, i₂}ᶜ.card)⁻¹ else 0
      | circumcenterIndex => 0

tactic: have hu : card ({i₁, i₂}ᶜ : Finset (Fin (n + 3))) = n + 1 := by
  simp [card_compl, Fintype.card_fin, h]
state_before: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
⊢ (match pointIndex i with
    | pointIndex i => if i = i₁ ∨ i = i₂ then (↑(n + 1))⁻¹ else 0
    | circumcenterIndex => -2 / ↑(n + 1)) =
    (match pointIndex i with
      | pointIndex a => (↑(n + 1))⁻¹
      | circumcenterIndex => -2 / ↑(n + 1)) -
      match pointIndex i with
      | pointIndex i => if i ∈ {i₁, i₂}ᶜ then (↑{i₁, i₂}ᶜ.card)⁻¹ else 0
      | circumcenterIndex => 0
state_after: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
hu : {i₁, i₂}ᶜ.card = n + 1
⊢ (match pointIndex i with
    | pointIndex i => if i = i₁ ∨ i = i₂ then (↑(n + 1))⁻¹ else 0
    | circumcenterIndex => -2 / ↑(n + 1)) =
    (match pointIndex i with
      | pointIndex a => (↑(n + 1))⁻¹
      | circumcenterIndex => -2 / ↑(n + 1)) -
      match pointIndex i with
      | pointIndex i => if i ∈ {i₁, i₂}ᶜ then (↑{i₁, i₂}ᶜ.card)⁻¹ else 0
      | circumcenterIndex => 0

tactic: rw [hu]
state_before: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
hu : {i₁, i₂}ᶜ.card = n + 1
⊢ (match pointIndex i with
    | pointIndex i => if i = i₁ ∨ i = i₂ then (↑(n + 1))⁻¹ else 0
    | circumcenterIndex => -2 / ↑(n + 1)) =
    (match pointIndex i with
      | pointIndex a => (↑(n + 1))⁻¹
      | circumcenterIndex => -2 / ↑(n + 1)) -
      match pointIndex i with
      | pointIndex i => if i ∈ {i₁, i₂}ᶜ then (↑{i₁, i₂}ᶜ.card)⁻¹ else 0
      | circumcenterIndex => 0
state_after: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
hu : {i₁, i₂}ᶜ.card = n + 1
⊢ (match pointIndex i with
    | pointIndex i => if i = i₁ ∨ i = i₂ then (↑(n + 1))⁻¹ else 0
    | circumcenterIndex => -2 / ↑(n + 1)) =
    (match pointIndex i with
      | pointIndex a => (↑(n + 1))⁻¹
      | circumcenterIndex => -2 / ↑(n + 1)) -
      match pointIndex i with
      | pointIndex i => if i ∈ {i₁, i₂}ᶜ then (↑(n + 1))⁻¹ else 0
      | circumcenterIndex => 0

tactic: by_cases hi : i = i₁ ∨ i = i₂ <;> simp [compl_eq_univ_sdiff, hi]
state_before: case h.pointIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
hu : {i₁, i₂}ᶜ.card = n + 1
⊢ (match pointIndex i with
    | pointIndex i => if i = i₁ ∨ i = i₂ then (↑(n + 1))⁻¹ else 0
    | circumcenterIndex => -2 / ↑(n + 1)) =
    (match pointIndex i with
      | pointIndex a => (↑(n + 1))⁻¹
      | circumcenterIndex => -2 / ↑(n + 1)) -
      match pointIndex i with
      | pointIndex i => if i ∈ {i₁, i₂}ᶜ then (↑(n + 1))⁻¹ else 0
      | circumcenterIndex => 0
state_after: no goals

tactic: simp [card_compl, Fintype.card_fin, h]
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
i : Fin (n + 2 + 1)
⊢ {i₁, i₂}ᶜ.card = n + 1
state_after: no goals

tactic: simp [mongePointWeightsWithCircumcenter, centroidWeightsWithCircumcenter,
  mongePointVSubFaceCentroidWeightsWithCircumcenter]
state_before: case h.circumcenterIndex
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
n : ℕ
i₁ i₂ : Fin (n + 3)
h : i₁ ≠ i₂
⊢ mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ circumcenterIndex =
    (mongePointWeightsWithCircumcenter n - centroidWeightsWithCircumcenter {i₁, i₂}ᶜ) circumcenterIndex
state_after: no goals