  We use a 30-nm x-ray beam to study the spatially resolved properties of a
SmNiO$_3$-based nanodevice that is doped with protons. The x-ray absorption
spectra supported by density-functional theory (DFT) simulations show partial
reduction of nickel valence in the region with high proton concentration, which
leads to the insulating behavior. Concurrently, x-ray diffraction reveals only
a small lattice distortion in the doped regions. Together, our results directly
show that the knob which proton doping modifies is the electronic valency, and
not the crystal lattice. The studies are relevant to on-going efforts to
disentangle structural and electronic effects across metal-insulator phase
transitions in correlated oxides.
