@@ -763,8 +763,6 @@ section InsertNth
763
763
764
764
variable {α : Fin (n + 1 ) → Sort *} {β : Sort *}
765
765
766
- /- Porting note: Lean told me `(fun x x_1 ↦ α x)` was an invalid motive, but disabling
767
- automatic insertion and specifying that motive seems to work. -/
768
766
/-- Define a function on `Fin (n + 1)` from a value on `i : Fin (n + 1)` and values on each
769
767
`Fin.succAbove i j`, `j : Fin n`. This version is elaborated as eliminator and works for
770
768
propositions, see also `Fin.insertNth` for a version without an `@[elab_as_elim]`
@@ -774,9 +772,8 @@ def succAboveCases {α : Fin (n + 1) → Sort u} (i : Fin (n + 1)) (x : α i)
774
772
(p : ∀ j : Fin n, α (i.succAbove j)) (j : Fin (n + 1 )) : α j :=
775
773
if hj : j = i then Eq.rec x hj.symm
776
774
else
777
- if hlt : j < i then @Eq.recOn _ _ (fun x _ ↦ α x) _ (succAbove_castPred_of_lt _ _ hlt) (p _)
778
- else @Eq.recOn _ _ (fun x _ ↦ α x) _ (succAbove_pred_of_lt _ _ <|
779
- (Fin.lt_or_lt_of_ne hj).resolve_left hlt) (p _)
775
+ if hlt : j < i then (succAbove_castPred_of_lt _ _ hlt) ▸ (p _)
776
+ else (succAbove_pred_of_lt _ _ <| (Fin.lt_or_lt_of_ne hj).resolve_left hlt) ▸ (p _)
780
777
781
778
-- This is a duplicate of `Fin.exists_fin_succ` in Core. We should upstream the name change.
782
779
alias forall_iff_succ := forall_fin_succ
@@ -906,20 +903,14 @@ theorem insertNth_right_injective {p : Fin (n + 1)} (x : α p) :
906
903
Function.Injective (insertNth p x) :=
907
904
insertNth_injective2.right _
908
905
909
- /- Porting note: Once again, Lean told me `(fun x x_1 ↦ α x)` was an invalid motive, but disabling
910
- automatic insertion and specifying that motive seems to work. -/
911
906
theorem insertNth_apply_below {i j : Fin (n + 1 )} (h : j < i) (x : α i)
912
907
(p : ∀ k, α (i.succAbove k)) :
913
- i.insertNth x p j = @Eq.recOn _ _ (fun x _ ↦ α x) _
914
- (succAbove_castPred_of_lt _ _ h) (p <| j.castPred _) := by
908
+ i.insertNth x p j = succAbove_castPred_of_lt _ _ h ▸ (p <| j.castPred _) := by
915
909
rw [insertNth, succAboveCases, dif_neg (Fin.ne_of_lt h), dif_pos h]
916
910
917
- /- Porting note: Once again, Lean told me `(fun x x_1 ↦ α x)` was an invalid motive, but disabling
918
- automatic insertion and specifying that motive seems to work. -/
919
911
theorem insertNth_apply_above {i j : Fin (n + 1 )} (h : i < j) (x : α i)
920
912
(p : ∀ k, α (i.succAbove k)) :
921
- i.insertNth x p j = @Eq.recOn _ _ (fun x _ ↦ α x) _
922
- (succAbove_pred_of_lt _ _ h) (p <| j.pred _) := by
913
+ i.insertNth x p j = succAbove_pred_of_lt _ _ h ▸ (p <| j.pred _) := by
923
914
rw [insertNth, succAboveCases, dif_neg (Fin.ne_of_gt h), dif_neg (Fin.lt_asymm h)]
924
915
925
916
theorem insertNth_zero (x : α 0 ) (p : ∀ j : Fin n, α (succAbove 0 j)) :
0 commit comments