This PR changes the signature of `Array.get` to take a Nat and a proof, rather than a `Fin`, for consistency with the rest of the (planned) Array API. Note that because of bootstrapping issues we can't provide `get_elem_tactic` as an autoparameter for the proof. As users will mostly use the `xs[i]` notation provided by `GetElem`, this hopefully isn't a problem. We may restore `Fin` based versions, either here or downstream, as needed, but they won't be the "main" functions. --------- Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk>
33 lines
690 B
Text
33 lines
690 B
Text
--
|
||
|
||
structure S :=
|
||
(g {α} : α → α)
|
||
|
||
def f (h : Nat → ({α : Type} → α → α) × Bool) : Nat :=
|
||
(h 0).1 1
|
||
|
||
def tst : Nat :=
|
||
f fun n => (fun x => x, true)
|
||
|
||
def ex : id (Nat → Nat) :=
|
||
by {
|
||
intro;
|
||
assumption
|
||
}
|
||
|
||
def g (i j k : Nat) (a : Array Nat) (h₁ : i < k) (h₂ : k < j) (h₃ : j < a.size) : Nat :=
|
||
let vj := a[j];
|
||
let vi := a[i];
|
||
vi + vj
|
||
|
||
set_option pp.all true in
|
||
#print g
|
||
|
||
#check g.proof_1
|
||
|
||
theorem ex1 {p q r s : Prop} : p ∧ q ∧ r ∧ s → r ∧ s ∧ q ∧ p :=
|
||
fun ⟨hp, hq, hr, hs⟩ => ⟨hr, hs, hq, hp⟩
|
||
|
||
theorem ex2 {p q r s : Prop} : p ∧ q ∧ r ∧ s → r ∧ s ∧ q ∧ p := by
|
||
intro ⟨hp, hq, hr, hs⟩
|
||
exact ⟨hr, hs, hq, hp⟩
|