A compound represented by formula: wherein, in formula, R 1 is alkyl having 1 to 15 carbons, alkenyl having 2 to 15 carbons, alkoxy having 1 to 14 carbons or alkenyloxy having 2 to 14 carbons, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine; ring A 1 and ring A 4 are independently 1,4-cyclohexylene, 1,4-cyclohexenylene, 1,4-phenylene, naphthalene-2,6-diyl, decahydronaphthalene-2,6-diyl, 1,2,3,4-tetrahydronaphthalene-2,6-diyl, tetrahydropyran-2,5-diyl, 1,3-dioxane-2,5-diyl, pyrimidine-2,5-diyl, pyridine-2,5-diyl, perhydrocyclopenta[a]phenanthrene-3,17-diyl or 2,3,4,7,8,9,10,11,12,13,14,15,16,17-tetradecahydrocyclopenta[a]phenanthrene-3,17-diyl, and in the rings, at least one piece of hydrogen may be replaced by fluorine, chlorine, alkyl having 1 to 12 carbons, alkenyl having 2 to 12 carbons, alkoxy having 1 to 11 carbons or alkenyloxy having 2 to 11 carbons, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine; Z 1 is a single bond, -(CH 2) 2 -, -CH=CH-, -C≡C-, -COO-, -OCO-, -CF 2 O-, -OCF 2 -, -CH 2 O-, -OCH 2 - or -CF=CF-; Sp 1 and Sp 2 are independently a single bond or alkylene having 1 to 10 carbons, and in the alkylene, at least one piece of -CH 2 - may be replaced by -O-, -COO- or -OCO-, and at least one piece of -(CH 2) 2 - may be replaced by -CH=CH-, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine; M 1 and M 2 are independently hydrogen, fluorine, alkyl having 1 to 5 carbons, or alkyl having 1 to 5 carbons in which at least one piece of hydrogen is replaced by fluorine; X 1 is a group represented by -OH, -NH 2, -OR 3, -N(R 3) 2, formula, -COOH, -SH, -B 2 or -Si(R 3) 3, in which R 3 is hydrogen or alkyl having 1 to 10 carbons, and in the alkyl, at least one piece of -CH 2 - may be replaced by -O-, and at least one piece of -(CH 2) 2 - may be replaced by -CH=CH-, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine, and w in formula is 1, 2, 3 or 4; and wherein, a is 0, 1, 2, 3 or 4. R 1 is alkyl having 1 to 15 carbons, alkenyl having 2 to 15 carbons, alkoxy having 1 to 14 carbons or alkenyloxy having 2 to 14 carbons, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine; ring A 1 and ring A 4 are independently 1,4-cyclohexylene, 1,4-cyclohexenylene, 1,4-phenylene, naphthalene-2,6-diyl, decahydronaphthalene-2,6-diyl, 1,2,3,4-tetrahydronaphthalene-2,6-diyl, tetrahydropyran-2,5-diyl, 1,3-dioxane-2,5-diyl, pyrimidine-2,5-diyl, pyridine-2,5-diyl, perhydrocyclopenta[a]phenanthrene-3,17-diyl or 2,3,4,7,8,9,10,11,12,13,14,15,16,17-tetradecahydrocyclopenta[a]phenanthrene-3,17-diyl, and in the rings, at least one piece of hydrogen may be replaced by fluorine, chlorine, alkyl having 1 to 12 carbons, alkenyl having 2 to 12 carbons, alkoxy having 1 to 11 carbons or alkenyloxy having 2 to 11 carbons, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine; Z 1 is a single bond, -(CH 2) 2 -, -CH=CH-, -C≡C-, -COO-, -OCO-, -CF 2 O-, -OCF 2 -, -CH 2 O-, -OCH 2 - or -CF=CF-; Sp 1 and Sp 2 are independently a single bond or alkylene having 1 to 10 carbons, and in the alkylene, at least one piece of -CH 2 - may be replaced by -O-, -COO- or -OCO-, and at least one piece of -(CH 2) 2 - may be replaced by -CH=CH-, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine; M 1 and M 2 are independently hydrogen, fluorine, alkyl having 1 to 5 carbons, or alkyl having 1 to 5 carbons in which at least one piece of hydrogen is replaced by fluorine; X 1 is a group represented by -OH, -NH 2, -OR 3, -N(R 3) 2, formula, -COOH, -SH, -B 2 or -Si(R 3) 3, in which R 3 is hydrogen or alkyl having 1 to 10 carbons, and in the alkyl, at least one piece of -CH 2 - may be replaced by -O-, and at least one piece of -(CH 2) 2 - may be replaced by -CH=CH-, and in the groups, at least one piece of hydrogen may be replaced by fluorine or chlorine, and w in formula is 1, 2, 3 or 4; and wherein, a is 0, 1, 2, 3 or 4.