n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
⊢ (M ⬝ List.prod (listTransvecRow M)) (inr ()) (inl i) = 0

case H
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
⊢ ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
⊢ (M ⬝ List.prod (listTransvecRow M)) (inr ()) (inl i) = 0
suffices H :
  ∀ k : ℕ,
    k ≤ r →
      (M ⬝ ((listTransvecRow M).take k).prod) (inr unit) (inl i) =
        if k ≤ i then M (inr unit) (inl i) else 0
case H
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk : k ≤ r
⊢ (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
case H
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
⊢ ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
intro k hk
case H.zero
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
hk : Nat.zero ≤ r
⊢ (M ⬝ List.prod (List.take Nat.zero (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.zero ≤ ↑i then M (inr ()) (inl i) else 0

case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case H
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk : k ≤ r
⊢ (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
induction' k with n IH
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
⊢ (M ⬝ List.prod (listTransvecRow M)) (inr ()) (inl i) = 0
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
⊢ (M ⬝ List.prod (listTransvecRow M)) (inr ()) (inl i) = 0
have A : (listTransvecRow M).length = r := by simp [listTransvecRow]
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
⊢ (M ⬝ List.prod (List.take r (listTransvecRow M))) (inr ()) (inl i) = 0
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
⊢ (M ⬝ List.prod (listTransvecRow M)) (inr ()) (inl i) = 0
rw [← List.take_length (listTransvecRow M), A]
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
this : ¬r ≤ ↑i
⊢ (M ⬝ List.prod (List.take r (listTransvecRow M))) (inr ()) (inl i) = 0
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
⊢ (M ⬝ List.prod (List.take r (listTransvecRow M))) (inr ()) (inl i) = 0
have : ¬r ≤ i := by simp
no goals
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
this : ¬r ≤ ↑i
⊢ (M ⬝ List.prod (List.take r (listTransvecRow M))) (inr ()) (inl i) = 0
simpa only [this, ite_eq_right_iff] using H r le_rfl
no goals
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
⊢ List.length (listTransvecRow M) = r
simp [listTransvecRow]
no goals
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
H :
  ∀ (k : ℕ),
    k ≤ r →
      (M ⬝ List.prod (List.take k (listTransvecRow M))) (inr ()) (inl i) = if k ≤ ↑i then M (inr ()) (inl i) else 0
A : List.length (listTransvecRow M) = r
⊢ ¬r ≤ ↑i
simp
no goals
case H.zero
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
hk : Nat.zero ≤ r
⊢ (M ⬝ List.prod (List.take Nat.zero (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.zero ≤ ↑i then M (inr ()) (inl i) else 0
simp only [if_true, Matrix.mul_one, List.take_zero, zero_le', List.prod_nil, Nat.zero_eq]
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
have hnr : n < r := hk
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
let n' : Fin r := ⟨n, hnr⟩
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
have A :
  (listTransvecRow M).get? n =
    ↑(transvection (inr unit) (inl n')
    (-M (inr unit) (inl n') / M (inr unit) (inr unit))) := by
  simp only [listTransvecRow, List.ofFnNthVal, hnr, dif_pos, List.get?_ofFn]
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
⊢ (M ⬝ List.prod (List.take (Nat.succ n) (listTransvecRow M))) (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
simp only [List.take_succ, A, ← Matrix.mul_assoc, List.prod_append, Matrix.mul_one,
  Matrix.mul_eq_mul, List.prod_cons, List.prod_nil, Option.to_list_some]
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0

case neg
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case H.succ
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
by_cases h : n' = i
no goals
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
⊢ List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
simp only [listTransvecRow, List.ofFnNthVal, hnr, dif_pos, List.get?_ofFn]
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
have hni : n = i := by
  cases i
  simp only [Fin.mk_eq_mk] at h
  simp only [h]
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
this : ¬Nat.succ n ≤ ↑i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
have : ¬n.succ ≤ i := by simp only [← hni, n.lt_succ_self, not_le]
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
this : ¬Nat.succ n ≤ ↑i
⊢ M (inr ()) (inl i) + -M (inr ()) (inl i) / M (inr ()) (inr ()) * M (inr ()) (inr ()) = 0
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
this : ¬Nat.succ n ≤ ↑i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
simp only [h, mul_transvection_apply_same, List.take, if_false,
  mul_listTransvecRow_last_col_take _ _ hnr.le, hni.le, this, if_true, IH hnr.le]
no goals
case pos
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
this : ¬Nat.succ n ≤ ↑i
⊢ M (inr ()) (inl i) + -M (inr ()) (inl i) / M (inr ()) (inr ()) * M (inr ()) (inr ()) = 0
field_simp [hM]
case mk
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
k : ℕ
hk✝ : k ≤ r
n : ℕ
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
val✝ : ℕ
isLt✝ : val✝ < r
IH :
  n ≤ r →
    (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl { val := val✝, isLt := isLt✝ }) =
      if n ≤ ↑{ val := val✝, isLt := isLt✝ } then M (inr ()) (inl { val := val✝, isLt := isLt✝ }) else 0
h : n' = { val := val✝, isLt := isLt✝ }
⊢ n = ↑{ val := val✝, isLt := isLt✝ }
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
⊢ n = ↑i
cases i
case mk
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
k : ℕ
hk✝ : k ≤ r
n : ℕ
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
val✝ : ℕ
isLt✝ : val✝ < r
IH :
  n ≤ r →
    (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl { val := val✝, isLt := isLt✝ }) =
      if n ≤ ↑{ val := val✝, isLt := isLt✝ } then M (inr ()) (inl { val := val✝, isLt := isLt✝ }) else 0
h : n = val✝
⊢ n = ↑{ val := val✝, isLt := isLt✝ }
case mk
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
k : ℕ
hk✝ : k ≤ r
n : ℕ
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
val✝ : ℕ
isLt✝ : val✝ < r
IH :
  n ≤ r →
    (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl { val := val✝, isLt := isLt✝ }) =
      if n ≤ ↑{ val := val✝, isLt := isLt✝ } then M (inr ()) (inl { val := val✝, isLt := isLt✝ }) else 0
h : n' = { val := val✝, isLt := isLt✝ }
⊢ n = ↑{ val := val✝, isLt := isLt✝ }
simp only [Fin.mk_eq_mk] at h
no goals
case mk
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
k : ℕ
hk✝ : k ≤ r
n : ℕ
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
val✝ : ℕ
isLt✝ : val✝ < r
IH :
  n ≤ r →
    (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl { val := val✝, isLt := isLt✝ }) =
      if n ≤ ↑{ val := val✝, isLt := isLt✝ } then M (inr ()) (inl { val := val✝, isLt := isLt✝ }) else 0
h : n = val✝
⊢ n = ↑{ val := val✝, isLt := isLt✝ }
simp only [h]
no goals
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : n' = i
hni : n = ↑i
⊢ ¬Nat.succ n ≤ ↑i
simp only [← hni, n.lt_succ_self, not_le]
case neg
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case neg
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
have hni : n ≠ i := by
  rintro rfl
  cases i
  tauto
case neg
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
⊢ (if n ≤ ↑i then M (inr ()) (inl i) else 0) = if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case neg
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
⊢ (M ⬝ List.prod (List.take n (listTransvecRow M)) ⬝
        transvection (inr ()) (inl { val := n, isLt := hnr })
          (-M (inr ()) (inl { val := n, isLt := hnr }) / M (inr ()) (inr ())))
      (inr ()) (inl i) =
    if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
simp only [IH hnr.le, Ne.def, mul_transvection_apply_of_ne, Ne.symm h, inl.injEq]
case neg.inl
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : n + 1 ≤ ↑i
⊢ (if n ≤ ↑i then M (inr ()) (inl i) else 0) = if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0

case neg.inr
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : ↑i < n + 1
⊢ (if n ≤ ↑i then M (inr ()) (inl i) else 0) = if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
case neg
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
⊢ (if n ≤ ↑i then M (inr ()) (inl i) else 0) = if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
rcases le_or_lt (n + 1) i with (hi | hi)
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
IH :
  ↑i ≤ r →
    (M ⬝ List.prod (List.take (↑i) (listTransvecRow M))) (inr ()) (inl i) = if ↑i ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ ↑i ≤ r
hnr : ↑i < r
n' : Fin r := { val := ↑i, isLt := hnr }
A :
  List.get? (listTransvecRow M) ↑i = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
⊢ False
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
⊢ n ≠ ↑i
rintro rfl
case mk
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
k : ℕ
hk✝ : k ≤ r
val✝ : ℕ
isLt✝ : val✝ < r
IH :
  ↑{ val := val✝, isLt := isLt✝ } ≤ r →
    (M ⬝ List.prod (List.take (↑{ val := val✝, isLt := isLt✝ }) (listTransvecRow M))) (inr ())
        (inl { val := val✝, isLt := isLt✝ }) =
      if ↑{ val := val✝, isLt := isLt✝ } ≤ ↑{ val := val✝, isLt := isLt✝ } then
        M (inr ()) (inl { val := val✝, isLt := isLt✝ })
      else 0
hk : Nat.succ ↑{ val := val✝, isLt := isLt✝ } ≤ r
hnr : ↑{ val := val✝, isLt := isLt✝ } < r
n' : Fin r := { val := ↑{ val := val✝, isLt := isLt✝ }, isLt := hnr }
A :
  List.get? (listTransvecRow M) ↑{ val := val✝, isLt := isLt✝ } =
    some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = { val := val✝, isLt := isLt✝ }
⊢ False
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
IH :
  ↑i ≤ r →
    (M ⬝ List.prod (List.take (↑i) (listTransvecRow M))) (inr ()) (inl i) = if ↑i ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ ↑i ≤ r
hnr : ↑i < r
n' : Fin r := { val := ↑i, isLt := hnr }
A :
  List.get? (listTransvecRow M) ↑i = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
⊢ False
cases i
no goals
case mk
n : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
k : ℕ
hk✝ : k ≤ r
val✝ : ℕ
isLt✝ : val✝ < r
IH :
  ↑{ val := val✝, isLt := isLt✝ } ≤ r →
    (M ⬝ List.prod (List.take (↑{ val := val✝, isLt := isLt✝ }) (listTransvecRow M))) (inr ())
        (inl { val := val✝, isLt := isLt✝ }) =
      if ↑{ val := val✝, isLt := isLt✝ } ≤ ↑{ val := val✝, isLt := isLt✝ } then
        M (inr ()) (inl { val := val✝, isLt := isLt✝ })
      else 0
hk : Nat.succ ↑{ val := val✝, isLt := isLt✝ } ≤ r
hnr : ↑{ val := val✝, isLt := isLt✝ } < r
n' : Fin r := { val := ↑{ val := val✝, isLt := isLt✝ }, isLt := hnr }
A :
  List.get? (listTransvecRow M) ↑{ val := val✝, isLt := isLt✝ } =
    some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = { val := val✝, isLt := isLt✝ }
⊢ False
tauto
no goals
case neg.inl
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : n + 1 ≤ ↑i
⊢ (if n ≤ ↑i then M (inr ()) (inl i) else 0) = if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
simp [hi, n.le_succ.trans hi, if_true]
case neg.inr.hnc
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : ↑i < n + 1
⊢ ¬Nat.succ n ≤ ↑i

case neg.inr.hnc
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : ↑i < n + 1
⊢ ¬n ≤ ↑i
case neg.inr
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : ↑i < n + 1
⊢ (if n ≤ ↑i then M (inr ()) (inl i) else 0) = if Nat.succ n ≤ ↑i then M (inr ()) (inl i) else 0
rw [if_neg, if_neg]
no goals
case neg.inr.hnc
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : ↑i < n + 1
⊢ ¬Nat.succ n ≤ ↑i
simpa only [not_le] using hi
no goals
case neg.inr.hnc
n✝ : Type ?u.187814
p : Type ?u.187817
R : Type u₂
𝕜 : Type u_1
inst✝³ : Field 𝕜
inst✝² : DecidableEq n✝
inst✝¹ : DecidableEq p
inst✝ : CommRing R
r : ℕ
M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜
hM : M (inr ()) (inr ()) ≠ 0
i : Fin r
k : ℕ
hk✝ : k ≤ r
n : ℕ
IH :
  n ≤ r → (M ⬝ List.prod (List.take n (listTransvecRow M))) (inr ()) (inl i) = if n ≤ ↑i then M (inr ()) (inl i) else 0
hk : Nat.succ n ≤ r
hnr : n < r
n' : Fin r := { val := n, isLt := hnr }
A : List.get? (listTransvecRow M) n = some (transvection (inr ()) (inl n') (-M (inr ()) (inl n') / M (inr ()) (inr ())))
h : ¬n' = i
hni : n ≠ ↑i
hi : ↑i < n + 1
⊢ ¬n ≤ ↑i
simpa only [hni.symm, not_le, or_false_iff] using Nat.lt_succ_iff_lt_or_eq.1 hi