Step
*
of Lemma
filter-equals
∀[T:Type]
  ∀P:T ⟶ 𝔹. ∀L1,L2:T List.
    (filter(P;L1) = L2 ∈ (T List)
       
⇐⇒ (∀x:T. ((x ∈ L2) 
⇐⇒ (x ∈ L1) ∧ (↑(P x)))) ∧ (∀x,y:T.  (x before y ∈ L2 
⇒ x before y ∈ L1))) supposing 
       (no_repeats(T;L2) and 
       no_repeats(T;L1))
BY
{ InductionOnList }
1
1. [T] : Type
2. P : T ⟶ 𝔹
⊢ ∀L2:T List
    (filter(P;[]) = L2 ∈ (T List)
       
⇐⇒ (∀x:T. ((x ∈ L2) 
⇐⇒ (x ∈ []) ∧ (↑(P x)))) ∧ (∀x,y:T.  (x before y ∈ L2 
⇒ x before y ∈ []))) supposing 
       (no_repeats(T;L2) and 
       no_repeats(T;[]))
2
1. [T] : Type
2. P : T ⟶ 𝔹
3. u : T
4. v : T List
5. ∀L2:T List
     (filter(P;v) = L2 ∈ (T List)
        
⇐⇒ (∀x:T. ((x ∈ L2) 
⇐⇒ (x ∈ v) ∧ (↑(P x)))) ∧ (∀x,y:T.  (x before y ∈ L2 
⇒ x before y ∈ v))) supposing 
        (no_repeats(T;L2) and 
        no_repeats(T;v))
⊢ ∀L2:T List
    (filter(P;[u / v]) = L2 ∈ (T List)
       
⇐⇒ (∀x:T. ((x ∈ L2) 
⇐⇒ (x ∈ [u / v]) ∧ (↑(P x))))
           ∧ (∀x,y:T.  (x before y ∈ L2 
⇒ x before y ∈ [u / v]))) supposing 
       (no_repeats(T;L2) and 
       no_repeats(T;[u / v]))
Latex:
Latex:
\mforall{}[T:Type]
    \mforall{}P:T  {}\mrightarrow{}  \mBbbB{}.  \mforall{}L1,L2:T  List.
        (filter(P;L1)  =  L2
              \mLeftarrow{}{}\mRightarrow{}  (\mforall{}x:T.  ((x  \mmember{}  L2)  \mLeftarrow{}{}\mRightarrow{}  (x  \mmember{}  L1)  \mwedge{}  (\muparrow{}(P  x))))
                      \mwedge{}  (\mforall{}x,y:T.    (x  before  y  \mmember{}  L2  {}\mRightarrow{}  x  before  y  \mmember{}  L1)))  supposing 
              (no\_repeats(T;L2)  and 
              no\_repeats(T;L1))
By
Latex:
InductionOnList
Home
Index