Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Sep 30, 2024
1 parent c47b735 commit ccd731c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Batteries/Data/Array/Pairwise.lean
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ theorem pairwise_pair : #[a, b].Pairwise R ↔ R a b := by

theorem pairwise_append {as bs : Array α} :
(as ++ bs).Pairwise R ↔ as.Pairwise R ∧ bs.Pairwise R ∧ (∀ x ∈ as, ∀ y ∈ bs, R x y) := by
unfold Pairwise; simp [← mem_toList, append_toList, ← List.pairwise_append]
unfold Pairwise; simp [← mem_toList, toList_append, ← List.pairwise_append]

theorem pairwise_push {as : Array α} :
(as.push a).Pairwise R ↔ as.Pairwise R ∧ (∀ x ∈ as, R x a) := by
Expand All @@ -56,7 +56,7 @@ theorem pairwise_push {as : Array α} :

theorem pairwise_extract {as : Array α} (h : as.Pairwise R) (start stop) :
(as.extract start stop).Pairwise R := by
simp only [pairwise_iff_getElem, get_extract, size_extract] at h ⊢
simp only [pairwise_iff_getElem, getElem_extract, size_extract] at h ⊢
intro _ _ _ _ hlt
apply h
exact Nat.add_lt_add_left hlt start

0 comments on commit ccd731c

Please sign in to comment.