1 Introduction
Let denote the finite field of order , where is a prime power. An code over is a
dimensional vector subspace of
. A code over is called binary, ternary and quaternary, respectively. The elements of are called codewords and the weight of a codeword is the number of nonzero coordinates in . The minimum weight of is defined as , where denotes the zero vector of length .The Euclidean dual code of an code over is defined as where for . For any element , the conjugation of is defined as . The Hermitian dual code of an code over is defined as where for . A code over is called Euclidean linear complementary dual if . A code over is called Hermitian linear complementary dual if . These two families of codes are collectively called linear complementary dual (LCD for short) codes.
LCD codes were introduced by Massey [5] and gave an optimum linear coding solution for the two user binary adder channel. Recently, much work has been done concerning LCD codes for both theoretical and practical reasons. In particular, Carlet, Mesnager, Tang, Qi and Pellikaan [2] showed that any code over is equivalent to some Euclidean LCD code for and any code over is equivalent to some Hermitian LCD code for . This motivates us to study Euclidean LCD codes over and quaternary Hermitian LCD codes.
It is a fundamental problem to determine the largest minimum weight among all codes in a certain class of codes for a given pair . Let denote the largest minimum weight among all Euclidean LCD codes over . Let denote the largest minimum weight among all Hermitian LCD codes over . For codes and over , we say that is subcode of if . Galvez, Kim, Lee, Roe and Won [3] showed that any binary Euclidean LCD code contains a Euclidean LCD
subcode for odd integers
with . As a consequence, it can be easily shown that for odd . Then Carlet, Mesnager, Tang and Qi [1] showed that for even integers with .The main aim of this note is to establish the following theorem.
Theorem 1.
Suppose that . Then
2 Definitions, notations and basic results
For any element , the conjugation of is defined as . Let denote the transpose of a matrix . For a matrix , the conjugate matrix of is defined as . A matrix whose rows are linearly independent and generate a code over is called a generator matrix of . The following characterization is due to Massey [5].
Lemma 2.
Let be a code over (resp. ). Let be a generator matrix of . Then the following properties are equivalent:

is Euclidean (resp. Hermitian) LCD,

is Euclidean LCD (resp. is Hermitian LCD),

(resp. ) is nonsingular.
A code over is called Euclidean selforthogonal if . A code over is called Hermitian selforthogonal if . It is trivial that a code over is Euclidean selforthogonal if and only if for a generator matrix of , where
is the zero matrix. It is also trivial that a code
over is Hermitian selforthogonal if and only if for a generator matrix of .Lemma 3 (see [4, Theorem 1.4.10]).

Let be a ternary code. Then is Euclidean selforthogonal if and only if the weights of all codewords of are divisible by three.

Let be a quaternary code. Then is Hermitian selforthogonal if and only if the weights of all codewords of are even.
3 Proof of Theorem 1
As a consequence of the following proposition, we immediately have Theorem 1.
Proposition 4.
Suppose that .

Any ternary Euclidean LCD code contains a Euclidean LCD subcode.

Any quaternary Hermitian LCD code contains a Hermitian LCD subcode.
Proof.
The proofs of assertions (i) and (ii) are similar. In order that we simultaneously give the proofs, we employ the terms and notations listed in Table 1.



(i)  (ii)  
LCD  Euclidean LCD  Hermitian LCD 
selforthogonal  Euclidean selforthogonal  Hermitian selforthogonal 

Let be an LCD code over . Since is LCD, is not selforthogonal. By Lemma 3, there is a codeword of with . Note that . We may assume without loss of generality that the generator matrix of has one of the following forms:
where , and . For the matrices and , we consider the following matrices:
respectively. Note that . Therefore, has generator matrix of the following form:
satisfying that . Then we have
Since and , it follows that . By Lemma 2, the matrix is a generator matrix of an LCD code over with . ∎
4 Remarks
As another consequence of Proposition 4, we have the following:
Proposition 5.
Suppose that .

For any ternary Euclidean LCD code , there is a Euclidean LCD code containing as a subcode.

For any quaternary Hermitian LCD code , there is a Hermitian LCD code containing as a subcode.
Proof.
The proofs of assertions (i) and (ii) are similar. In order that we simultaneously give the proofs, we employ the terms and notations listed in Table 1. In addition, we denote and by for (i) and (ii), respectively. Let be an LCD code over . By Lemma 2, is LCD. By Proposition 4, there is an LCD code with . Again by Lemma 2, is an LCD code. Since , is an LCD code with . The result follows. ∎
Remark 6.
We give an alternative proof of the above proposition, which is constructive. Let the notations be as above. In addition, let be a generator matrix of . By Lemma 2, is LCD. Thus, is not selforthogonal. Hence, there is a nonzero vector of with . Note that and . Consider the following matrix:
Then we have
Since , it follows that . By Lemma 2, the matrix is a generator matrix of an LCD code over with .
As described in Section 1, any code over is equivalent to some Euclidean LCD code for and any code over is equivalent to some Hermitian LCD code for [2]. Hence, for any subcode of a Euclidean (resp. Hermitian) LCD code over () (resp. ()), there is a Euclidean (resp. Hermitian) LCD code such that is equivalent to . By Theorem 1, we have the following:
Corollary 7.
Suppose that . Then
References
 [1] C. Carlet, S. Mesnager, C. Tang and Y. Qi, New characterization and parametrization of LCD codes, IEEE Trans. Inform. Theory 65 (2019), 39–49.
 [2] C. Carlet, S. Mesnager, C. Tang, Y. Qi and R. Pellikaan, Linear codes over are equivalent to LCD codes for , IEEE Trans. Inform. Theory 64 (2018), 3010–3017.
 [3] L. Galvez, J.L. Kim, N. Lee, Y.G. Roe and B.S. Won, Some bounds on binary LCD codes, Cryptogr. Commun. 10 (2018), 719–728.
 [4] W.C. Huffman and V. Pless, Fundamentals of ErrorCorrecting Codes, Cambridge University Press, Cambridge, 2003.
 [5] J.L. Massey, Linear codes with complementary duals, Discrete Math. 106/107 (1992), 337–342.