Skip to content

Commit 7a8fd25

Browse files
committed
feat: add forall_fin_zero and exists_fin_zero
1 parent dfd3d18 commit 7a8fd25

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Init/Data/Fin/Lemmas.lean

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,16 +915,21 @@ theorem exists_fin_succ {P : Fin (n + 1) → Prop} : (∃ i, P i) ↔ P 0 ∨
915915
fun ⟨i, h⟩ => Fin.cases Or.inl (fun i hi => Or.inr ⟨i, hi⟩) i h, fun h =>
916916
(h.elim fun h => ⟨0, h⟩) fun ⟨i, hi⟩ => ⟨i.succ, hi⟩⟩
917917

918-
theorem forall_fin_one {p : Fin 1Prop} : (∀ i, p i) ↔ p 0 :=
918+
@[simp] theorem forall_fin_zero {p : Fin 0Prop} : (∀ i, p i) ↔ True :=
919+
fun _ => trivial, fun _ ⟨_, h⟩ => False.elim <| Nat.not_lt_zero _ h⟩
920+
921+
theorem exists_fin_zero {p : Fin 0Prop} : (∃ i, p i) ↔ False := by simp
922+
923+
@[simp] theorem forall_fin_one {p : Fin 1Prop} : (∀ i, p i) ↔ p 0 :=
919924
fun h => h _, fun h i => Subsingleton.elim i 0 ▸ h⟩
920925

921-
theorem exists_fin_one {p : Fin 1Prop} : (∃ i, p i) ↔ p 0 :=
926+
@[simp] theorem exists_fin_one {p : Fin 1Prop} : (∃ i, p i) ↔ p 0 :=
922927
fun ⟨i, h⟩ => Subsingleton.elim i 0 ▸ h, fun h => ⟨_, h⟩⟩
923928

924-
theorem forall_fin_two {p : Fin 2Prop} : (∀ i, p i) ↔ p 0 ∧ p 1 :=
929+
@[simp] theorem forall_fin_two {p : Fin 2Prop} : (∀ i, p i) ↔ p 0 ∧ p 1 :=
925930
forall_fin_succ.trans <| and_congr_right fun _ => forall_fin_one
926931

927-
theorem exists_fin_two {p : Fin 2Prop} : (∃ i, p i) ↔ p 0 ∨ p 1 :=
932+
@[simp] theorem exists_fin_two {p : Fin 2Prop} : (∃ i, p i) ↔ p 0 ∨ p 1 :=
928933
exists_fin_succ.trans <| or_congr_right exists_fin_one
929934

930935
theorem fin_two_eq_of_eq_zero_iff : ∀ {a b : Fin 2}, (a = 0 ↔ b = 0) → a = b := by

0 commit comments

Comments
 (0)