finiteSequence : ℕ ⟶ type ⟶ type ❘= [n : ℕ , A] {x : ℕ} ⊦ 1 ≤ x ⟶ ⊦ x ≤ n ⟶ A ❘# finSeq 1 2 ❙
❚
theory FinSeqProps : base:?Logic =
include arith:?RealArithmetics ❙
include ?FinSequences ❙
/T A disjoint ❙
prop_disjointFinSeq : {n : ℕ , A : type} finSeq n A ⟶ bool ❘= [n,A,fs] ∀[x] ∀[y] ∀[hx1] ∀[hx2] ∀[hy1] ∀[hy2] y ≐ x ∨ fs x hx1 hx2 ≠ fs y hy1 hy2❙
prop_ascendingfn : {n : ℕ} finSeq n ℝ ⟶ bool ❘ = [n,fsq] ∀[x] ∀[y] ∀[hx1] ∀[hx2] ∀[hy1 ] ∀[hy2] x ≤ y ⇒ arith?RealArithmetics?leq (fsq x hx1 hx2) (fsq y hy1 hy2) ❘# ascending 2 ❙
prop_strictly_ascendingfn : {n : ℕ} finSeq n ℝ ⟶ bool ❘ = [n,fsq] ∀[x] ∀[y] ∀[hx1] ∀[hx2] ∀[hy1 ] ∀[hy2] x ≤ y ⇒ arith?RealArithmetics?lessthan (fsq x hx1 hx2) (fsq y hy1 hy2) ❘# strictly_ascending 2 ❙
❚
theory FinSeqFunctions : base:?InductiveTypes =
include ?FinSequences ❙
include arith:?INatProps❙
finiteSequenceMap : {A : type} {B : type} {n : ℕ} finSeq n A ⟶ (A ⟶ B) ⟶ finSeq n B ❘= [A , B , n , fn , mp] [a ,b ,c] mp (fn a b c) ❘ # finSeqMap 4 5 ❙
finiteSequence : ℕ ⟶ type ⟶ type ❘= [n : ℕ , A] {x : ℕ} ⊦ 1 ≤ x ⟶ ⊦ x ≤ n ⟶ A ❘# finSeq 1 2 ❙
❚
theory FinSequencesOption : base:?Logic =
❚
theory FinSeqProps : base:?Logic =
include arith:?RealArithmetics ❙
include ?FinSequences ❙
/T A disjoint ❙
prop_disjointFinSeq : {n : ℕ , A : type} finSeq n A ⟶ bool ❘= [n,A,fs] ∀[x] ∀[y] ∀[hx1] ∀[hx2] ∀[hy1] ∀[hy2] y ≐ x ∨ fs x hx1 hx2 ≠ fs y hy1 hy2❙
prop_ascendingfn : {n : ℕ} finSeq n ℝ ⟶ bool ❘ = [n,fsq] ∀[x] ∀[y] ∀[hx1] ∀[hx2] ∀[hy1 ] ∀[hy2] x ≤ y ⇒ arith?RealArithmetics?leq (fsq x hx1 hx2) (fsq y hy1 hy2) ❘# ascending 2 ❙
prop_strictly_ascendingfn : {n : ℕ} finSeq n ℝ ⟶ bool ❘ = [n,fsq] ∀[x] ∀[y] ∀[hx1] ∀[hx2] ∀[hy1 ] ∀[hy2] x ≤ y ⇒ arith?RealArithmetics?lessthan (fsq x hx1 hx2) (fsq y hy1 hy2) ❘# strictly_ascending 2 ❙
❚
theory FinSeqFunctions : base:?InductiveTypes =
include ?FinSequences ❙
include arith:?INatProps❙
include http://gl.mathhub.info/MMT/LFX/Coproducts?LFCoprod ❙
finiteSequenceMap : {A : type} {B : type} {n : ℕ} finSeq n A ⟶ (A ⟶ B) ⟶ finSeq n B ❘= [A , B , n , fn , mp] [a ,b ,c] mp (fn a b c) ❘ # finSeqMap 4 5 ❙
// helper for finiteSequenceFoldLeft ❙
finiteSequenceFoldLeftLoop : {A : type}{B : type}{n : ℕ}{m : ℕ} (A ⟶ B ⟶ A) ⟶ A ⟶ finSeq n B ⟶ A ❘ = [A , B , n , m , f , start , fs] incIf ❙
finiteSequenceFoldLeft : {A : type}{B : type} {n : ℕ} (A ⟶ B ⟶ A) ⟶ A ⟶ finSeq n B ⟶ A ❘ # finSeqFoldL 1 2 3 4 5 6 ❙
finiteSequenceFoldLeftBZ : {A : type}{B : type}{f : A ⟶ B ⟶ A}{start : A}{fs : finSeq 0 B} ⊦ finiteSequenceFoldLeft A B 0 f start fs ≐ start❙
// finiteSequenceFoldLeftB : {A : type}{B : type}{n : ℕ}{f : A ⟶ B ⟶ A}{start : A}{fs : finSeq n B} ⊦ finSeqFoldL f start fs ≐ start❙