Keep or drop variables

keep(K, yes)
discard(K, no)

Arguments

K

Object of class kform

yes, no

Specification of dimensions to either keep (yes) or discard (no)

Details

Given a \(k\)-form \(\omega\), we have \(\omega(v_1,\ldots,v_k)\in\mathbb{R}\), where \(v_1,\ldots,v_k\in\mathbb{R}^n\). Now, discarding dimension \(i\) is equivalent to asserting (or guaranteeing) that \(e_i\cdot v_j=0\) for \(j=1,\ldots,k\). Alternatively, we may say that \(\omega(v_1,\ldots,v_k)\) is indeapendent of \(e_i\cdot v_j\) for \(j=1,\ldots,k\). If this is the case, we may ignore any row in which an \(i\) appears.

For \(k\)-forms, discarding (and its dual, keeping) is carried out in functions discard() and keep(). Function keep(omega, yes) keeps the terms specified and discard(omega, no) discards the terms specified.

Value

The functions documented here all return a kform object.

Author

Robin K. S. Hankin

See also

Examples


(o <- kform_general(7, 3, seq_len(choose(7, 3))))
#> An alternating linear map from V^3 to R with V=R^7:
#>            val
#>  2 5 6  =   18
#>  4 5 6  =   20
#>  3 4 6  =   16
#>  2 4 6  =   15
#>  1 5 7  =   27
#>  1 2 4  =    2
#>  1 3 6  =   12
#>  2 4 5  =    9
#>  1 4 5  =    8
#>  2 3 5  =    7
#>  1 3 5  =    6
#>  1 4 6  =   14
#>  2 3 6  =   13
#>  2 3 7  =   23
#>  1 4 7  =   24
#>  1 3 7  =   22
#>  2 4 7  =   25
#>  3 4 7  =   26
#>  4 5 7  =   30
#>  3 5 7  =   29
#>  1 6 7  =   31
#>  2 3 4  =    4
#>  1 2 7  =   21
#>  2 5 7  =   28
#>  3 6 7  =   33
#>  3 4 5  =   10
#>  1 2 6  =   11
#>  4 6 7  =   34
#>  1 2 3  =    1
#>  5 6 7  =   35
#>  3 5 6  =   19
#>  2 6 7  =   32
#>  1 2 5  =    5
#>  1 5 6  =   17
#>  1 3 4  =    3
keep(o, 1:4)     # keeps only terms with dimensions 1-4
#> An alternating linear map from V^3 to R with V=R^4:
#>            val
#>  1 3 4  =    3
#>  1 2 3  =    1
#>  2 3 4  =    4
#>  1 2 4  =    2
discard(o, 1:2)  # loses any term with "1" or "2" in the index
#> An alternating linear map from V^3 to R with V=R^7:
#>            val
#>  3 5 6  =   19
#>  5 6 7  =   35
#>  4 6 7  =   34
#>  3 4 5  =   10
#>  3 6 7  =   33
#>  3 5 7  =   29
#>  4 5 7  =   30
#>  3 4 7  =   26
#>  3 4 6  =   16
#>  4 5 6  =   20